pub struct Message<T> { /* private fields */ }
Expand description
A wrapped message which may be either typed or binary data.
Implementations§
Source§impl<T> Message<T>
impl<T> Message<T>
Sourcepub fn from_typed(typed: T) -> Message<T>
pub fn from_typed(typed: T) -> Message<T>
Wrap a typed item as a message.
Sourcepub fn as_ref_or_mut(&mut self) -> RefOrMut<'_, T>
pub fn as_ref_or_mut(&mut self) -> RefOrMut<'_, T>
Returns an immutable or mutable typed reference.
This method returns a mutable reference if the underlying data are typed Rust instances, which admit mutation, and it returns an immutable reference if the data are serialized binary data.
Source§impl<T> Message<T>where
T: Data,
impl<T> Message<T>where
T: Data,
Sourcepub fn from_bytes(bytes: Bytes) -> Message<T>
pub fn from_bytes(bytes: Bytes) -> Message<T>
Wrap bytes as a message.
Sourcepub fn length_in_bytes(&self) -> usize
pub fn length_in_bytes(&self) -> usize
The number of bytes required to serialize the data.
Sourcepub fn into_bytes<W>(&self, writer: &mut W)where
W: Write,
pub fn into_bytes<W>(&self, writer: &mut W)where
W: Write,
Writes the binary representation into writer
.
Trait Implementations§
Source§impl<T, C: Container, P: Pull<Bundle<T, C>>> Pull<Message<Message<T, C>>> for LogPuller<T, C, P>
impl<T, C: Container, P: Pull<Bundle<T, C>>> Pull<Message<Message<T, C>>> for LogPuller<T, C, P>
Source§impl<T: Eq + Data, C, P: Push<Bundle<T, C>>, H> Push<Message<Message<T, C>>> for Exchange<T, C, P, H>
impl<T: Eq + Data, C, P: Push<Bundle<T, C>>, H> Push<Message<Message<T, C>>> for Exchange<T, C, P, H>
Source§impl<T, C: Container, P: Push<Bundle<T, C>>> Push<Message<Message<T, C>>> for LogPusher<T, C, P>
impl<T, C: Container, P: Push<Bundle<T, C>>> Push<Message<Message<T, C>>> for LogPusher<T, C, P>
Auto Trait Implementations§
impl<T> Freeze for Message<T>where
T: Freeze,
impl<T> RefUnwindSafe for Message<T>where
T: RefUnwindSafe,
impl<T> Send for Message<T>
impl<T> Sync for Message<T>
impl<T> Unpin for Message<T>where
T: Unpin,
impl<T> UnwindSafe for Message<T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
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