Struct nats::Message [−][src]
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
impl Message
[src]
pub fn respond(&self, msg: impl AsRef<[u8]>) -> Result<()>
[src]
Respond to a request message.
pub fn ack(&self) -> Result<()>
[src]
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.
Requires the jetstream
feature.
pub fn ack_kind(&self, ack_kind: AckKind) -> Result<()>
[src]
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.
Requires the jetstream
feature.
pub fn double_ack(&self, ack_kind: AckKind) -> Result<()>
[src]
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.
Requires the jetstream
feature.
pub fn jetstream_message_info(&self) -> Option<JetStreamMessageInfo<'_>>
[src]
Returns the JetStream
message ID
if this is a JetStream
message.
Returns None
if this is not
a JetStream
message with headers
set.
Requires the jetstream
feature.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl !UnwindSafe for Message
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,