Struct nats::Message[][src]

pub struct Message {
    pub subject: String,
    pub reply: Option<String>,
    pub data: Vec<u8>,
    pub headers: Option<Headers>,
    // some fields omitted
}
Expand description

A message received on a subject.

Fields

subject: String

The subject this message came from.

reply: Option<String>

Optional reply subject that may be used for sending a response to this message.

data: Vec<u8>

The message contents.

headers: Option<Headers>

Optional headers associated with this Message.

Implementations

Respond to a request message.

Acknowledge a JetStream message with a default acknowledgement. See AckKind documentation for details of what other types of acks are available. If you need to send a non-default ack, use the ack_kind method below. If you need to block until the server acks your ack, use the double_ack method instead.

Returns immediately if this message has already been double-acked.

Acknowledge a JetStream message. See AckKind documentation for details of what each variant means. If you need to block until the server acks your ack, use the double_ack method instead.

Does not check whether this message has already been double-acked.

Acknowledge a JetStream message and wait for acknowledgement from the server that it has received our ack. Retry acknowledgement until we receive a response. See AckKind documentation for details of what each variant means.

Returns immediately if this message has already been double-acked.

Returns the JetStream message ID if this is a JetStream message. Returns None if this is not a JetStream message with headers set.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.