Struct timely::communication::message::Message
source · 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>
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>
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
source§impl<R, O, T> CopyOnto<ConsecutiveOffsetPairs<R, O>> for T
impl<R, O, T> CopyOnto<ConsecutiveOffsetPairs<R, O>> for T
source§fn copy_onto(
self,
target: &mut ConsecutiveOffsetPairs<R, O>
) -> <ConsecutiveOffsetPairs<R, O> as Region>::Index
fn copy_onto( self, target: &mut ConsecutiveOffsetPairs<R, O> ) -> <ConsecutiveOffsetPairs<R, O> as Region>::Index
Copy self into the target container, returning an index that allows to
look up the corresponding read item.