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: Write>(&self, writer: &mut W) -> Result<()>
pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<()>
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 Columnar for MessageHeader
impl Columnar for MessageHeader
§type Ref<'a> = MessageHeaderReference<<usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>>
where
usize: 'a
type Ref<'a> = MessageHeaderReference<<usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>, <usize as Columnar>::Ref<'a>> where usize: 'a
For each lifetime, a reference with that lifetime. Read more
source§fn copy_from<'a>(&mut self, other: Self::Ref<'a>)
fn copy_from<'a>(&mut self, other: Self::Ref<'a>)
Repopulates
self
from a reference. Read moresource§fn into_owned<'a>(other: Self::Ref<'a>) -> Self
fn into_owned<'a>(other: Self::Ref<'a>) -> Self
Produce an instance of
Self
from Self::Ref<'a>
.§type Container = MessageHeaderContainer<<usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container>
type Container = MessageHeaderContainer<<usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container>
The type that stores the columnar representation. Read more
source§fn as_columns<'a, I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = &'a Self>,
Self: 'a,
fn as_columns<'a, I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = &'a Self>,
Self: 'a,
Converts a sequence of the references to the type into columnar form.
source§fn into_columns<I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = Self>,
Self: Sized,
fn into_columns<I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = Self>,
Self: Sized,
Converts a sequence of the type into columnar form. Read more
source§impl Container<MessageHeader> for MessageHeaderContainer<<usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container>
impl Container<MessageHeader> for MessageHeaderContainer<<usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container, <usize as Columnar>::Container>
§type Borrowed<'a> = MessageHeaderContainer<<<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>>
where
usize: 'a
type Borrowed<'a> = MessageHeaderContainer<<<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>, <<usize as Columnar>::Container as Container<usize>>::Borrowed<'a>> where usize: 'a
The type of a borrowed container. Read more
source§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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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<R0, R1, R2, R3, R4> PartialEq<MessageHeader> for MessageHeaderReference<R0, R1, R2, R3, R4>
impl<R0, R1, R2, R3, R4> PartialEq<MessageHeader> for MessageHeaderReference<R0, R1, R2, R3, R4>
source§impl PartialEq for MessageHeader
impl PartialEq for MessageHeader
source§impl<'columnar, C0, C1, C2, C3, C4> Push<&'columnar MessageHeader> for MessageHeaderContainer<C0, C1, C2, C3, C4>
impl<'columnar, C0, C1, C2, C3, C4> Push<&'columnar MessageHeader> for MessageHeaderContainer<C0, C1, C2, C3, C4>
source§fn push(&mut self, item: &'columnar MessageHeader)
fn push(&mut self, item: &'columnar MessageHeader)
Pushes an item onto
self
.source§fn extend(&mut self, iter: impl IntoIterator<Item = T>)
fn extend(&mut self, iter: impl IntoIterator<Item = T>)
Pushes elements of an iterator onto
self
.source§impl<C0, C1, C2, C3, C4> Push<MessageHeader> for MessageHeaderContainer<C0, C1, C2, C3, C4>
impl<C0, C1, C2, C3, C4> Push<MessageHeader> for MessageHeaderContainer<C0, C1, C2, C3, C4>
source§fn push(&mut self, item: MessageHeader)
fn push(&mut self, item: MessageHeader)
Pushes an item onto
self
.source§fn extend(&mut self, iter: impl IntoIterator<Item = T>)
fn extend(&mut self, iter: impl IntoIterator<Item = T>)
Pushes elements of an iterator onto
self
.source§impl Serialize for MessageHeader
impl Serialize for MessageHeader
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
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.