pub struct Packet<A, T> { /* private fields */ }
Expand description
The packet receives from the unreliable connection.
Implementations§
Source§impl<A, T> Packet<A, T>
impl<A, T> Packet<A, T>
Sourcepub fn with_payload(self, val: Bytes) -> Packet<A, T>
pub fn with_payload(self, val: Bytes) -> Packet<A, T>
Sets the messages of the packet (Builder pattern)
Sourcepub fn with_from(self, val: A) -> Packet<A, T>
pub fn with_from(self, val: A) -> Packet<A, T>
Sets the address who sent the packet (Builder pattern)
Sourcepub fn with_timestamp(self, val: T) -> Packet<A, T>
pub fn with_timestamp(self, val: T) -> Packet<A, T>
Sets the instant when the packet was received (Builder pattern)
Source§impl<A, T> Packet<A, T>
impl<A, T> Packet<A, T>
Sourcepub fn into_components(self) -> (A, T, Bytes)
pub fn into_components(self) -> (A, T, Bytes)
Returns the raw contents of the packet.
Sourcepub fn set_timestamp(&mut self, timestamp: T) -> &mut Packet<A, T>
pub fn set_timestamp(&mut self, timestamp: T) -> &mut Packet<A, T>
Sets the instant when the packet was received
Sourcepub fn set_payload(&mut self, payload: Bytes) -> &mut Packet<A, T>
pub fn set_payload(&mut self, payload: Bytes) -> &mut Packet<A, T>
Sets the payload of the packet
Trait Implementations§
impl<A, T> Eq for Packet<A, T>
impl<A, T> StructuralPartialEq for Packet<A, T>
Auto Trait Implementations§
impl<A, T> !Freeze for Packet<A, T>
impl<A, T> RefUnwindSafe for Packet<A, T>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<A, T> Send for Packet<A, T>
impl<A, T> Sync for Packet<A, T>
impl<A, T> Unpin for Packet<A, T>
impl<A, T> UnwindSafe for Packet<A, T>where
A: UnwindSafe,
T: UnwindSafe,
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§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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more