Rust

writer

Module

Encodes client operations.

Contents

use utopia_nats::protocol::writer::Writer;
Rust
pub struct Writer

Encodes the operations a client sends, byte for byte as the server expects them.

Rust
use utopia_nats::protocol::Writer;

assert_eq!(Writer::publish("orders.new", b"hi", Some("_INBOX.1")), b"PUB orders.new _INBOX.1 2\r\nhi\r\n");
assert_eq!(Writer::sub("orders.>", "7", Some("workers")), b"SUB orders.> workers 7\r\n");