Skip to main content

encode_subject_segment

Function encode_subject_segment 

Source
pub fn encode_subject_segment(value: &str) -> String
Expand description

Re-exported so services only need to depend on arminius-lib-nats.

The message-bus Subscriber trait is intentionally not re-exported here to avoid clashing with the async_nats::Subscriber re-export above; reach it via arminius_lib_message_bus::Subscriber. Encodes a string for use as a single NATS subject segment by escaping the characters NATS reserves (see EscapingSubject).

The result contains no ., * or >, so it cannot split the segment or act as a wildcard. Use this on the client side when constructing command subjects. The matching decode is in __private::decode_subject_segment.