Struct timely::communication::networking::MessageHeader
source · pub struct MessageHeader {
pub channel: usize,
pub source: usize,
pub target: usize,
pub length: usize,
pub seqno: usize,
}
Expand description
Framing data for each Vec<u8>
transmission, indicating a typed channel, the source and
destination workers, and the length in bytes.
Fields§
§channel: usize
index of channel.
source: usize
index of worker sending message.
target: usize
index of worker receiving message.
length: usize
number of bytes in message.
seqno: usize
sequence number.
Implementations§
source§impl MessageHeader
impl MessageHeader
sourcepub fn try_read(bytes: &mut [u8]) -> Option<MessageHeader>
pub fn try_read(bytes: &mut [u8]) -> Option<MessageHeader>
Returns a header when there is enough supporting data
sourcepub fn write_to<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Write,
pub fn write_to<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Write,
Writes the header as binary data.
sourcepub fn required_bytes(&self) -> usize
pub fn required_bytes(&self) -> usize
The number of bytes required for the header and data.
Trait Implementations§
source§impl Clone for MessageHeader
impl Clone for MessageHeader
source§fn clone(&self) -> MessageHeader
fn clone(&self) -> MessageHeader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MessageHeader
impl Debug for MessageHeader
source§impl<'de> Deserialize<'de> for MessageHeader
impl<'de> Deserialize<'de> for MessageHeader
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for MessageHeader
impl Hash for MessageHeader
source§impl PartialEq for MessageHeader
impl PartialEq for MessageHeader
source§impl Serialize for MessageHeader
impl Serialize for MessageHeader
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for MessageHeader
impl Eq for MessageHeader
impl StructuralPartialEq for MessageHeader
Auto Trait Implementations§
impl Freeze for MessageHeader
impl RefUnwindSafe for MessageHeader
impl Send for MessageHeader
impl Sync for MessageHeader
impl Unpin for MessageHeader
impl UnwindSafe for MessageHeader
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)