pub struct Dispatch { /* private fields */ }Expand description
Represents an outgoing RabbitMQ message.
This dispatch owns only the encoded bytes of the outgoing payload, but not the payload itself. Furthermore, this dispatch provides no facilities for encoding the payload.
It is possible to directly create a
DispatchBuilder from an [Envelope].
Implementations§
Source§impl Dispatch
impl Dispatch
Sourcepub fn builder() -> DispatchBuilder
pub fn builder() -> DispatchBuilder
Creates a new DispatchBuilder.
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Shorthand for creating a Dispatch with the payload set to the given
bytes.
This method is specifically made to take an owned Vec<u8>, to make sure
no copying occurs and the bytes are simply moved into this dispatch.
When copying of bytes is acceptable or desired, use
from_byte_ref.
Sourcepub fn from_byte_ref(bytes: impl AsRef<[u8]>) -> Self
pub fn from_byte_ref(bytes: impl AsRef<[u8]>) -> Self
Shorthand for creating a Dispatch by copying the given bytes to the
payload.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dispatch
impl RefUnwindSafe for Dispatch
impl Send for Dispatch
impl Sync for Dispatch
impl Unpin for Dispatch
impl UnwindSafe for Dispatch
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more