pub enum Payload<M: MessageMetadata> {
Ack {
from_id: M::PeerId,
to_id: M::PeerId,
message_id: M::MessageId,
},
Message(M),
Poll {
from_id: M::PeerId,
to_id: M::PeerId,
},
}
Variants§
Implementations§
Source§impl<M: MessageMetadata> Payload<M>
impl<M: MessageMetadata> Payload<M>
pub fn source_id(&self) -> M::PeerId
pub fn destination_id(&self) -> M::PeerId
pub fn message_id(&self) -> Option<M::MessageId>
Trait Implementations§
Source§impl<'de, M> Deserialize<'de> for Payload<M>where
M: Deserialize<'de> + MessageMetadata,
M::PeerId: Deserialize<'de>,
M::MessageId: Deserialize<'de>,
impl<'de, M> Deserialize<'de> for Payload<M>where
M: Deserialize<'de> + MessageMetadata,
M::PeerId: Deserialize<'de>,
M::MessageId: Deserialize<'de>,
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
Auto Trait Implementations§
impl<M> Freeze for Payload<M>
impl<M> RefUnwindSafe for Payload<M>where
<M as MessageMetadata>::PeerId: RefUnwindSafe,
<M as MessageMetadata>::MessageId: RefUnwindSafe,
M: RefUnwindSafe,
impl<M> Send for Payload<M>
impl<M> Sync for Payload<M>
impl<M> Unpin for Payload<M>
impl<M> UnwindSafe for Payload<M>where
<M as MessageMetadata>::PeerId: UnwindSafe,
<M as MessageMetadata>::MessageId: UnwindSafe,
M: 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> 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