pub enum MsgPayload<Msg: UserMsgPayload> {
User(Msg),
RelaySignalingTo {
dst: PeerID,
data: RelayPayload,
},
RelaySignalingFrom {
src: PeerID,
data: RelayPayload,
},
Disconnect,
}Expand description
Every frame that crosses a data channel.
User is the only variant that surfaces to the application; the rest
are protocol-internal and consumed by crate::MeshNodeFSM.
Variants§
User(Msg)
Application payload sent via Peer::send / Peer::broadcast.
RelaySignalingTo
“Forward this to dst” — sent to a relay intermediary.
RelaySignalingFrom
“Here is a frame from src” — emitted by a relay intermediary to the destination.
Disconnect
Graceful-disconnect notice broadcast by a leaving peer.
Trait Implementations§
Source§impl<Msg: Clone + UserMsgPayload> Clone for MsgPayload<Msg>
impl<Msg: Clone + UserMsgPayload> Clone for MsgPayload<Msg>
Source§fn clone(&self) -> MsgPayload<Msg>
fn clone(&self) -> MsgPayload<Msg>
Returns a duplicate 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<Msg: Debug + UserMsgPayload> Debug for MsgPayload<Msg>
impl<Msg: Debug + UserMsgPayload> Debug for MsgPayload<Msg>
Source§impl<'de, Msg> Deserialize<'de> for MsgPayload<Msg>where
Msg: DeserializeOwned + UserMsgPayload,
impl<'de, Msg> Deserialize<'de> for MsgPayload<Msg>where
Msg: DeserializeOwned + UserMsgPayload,
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<Msg> Serialize for MsgPayload<Msg>where
Msg: Serialize + UserMsgPayload,
impl<Msg> Serialize for MsgPayload<Msg>where
Msg: Serialize + UserMsgPayload,
Auto Trait Implementations§
impl<Msg> Freeze for MsgPayload<Msg>where
Msg: Freeze,
impl<Msg> RefUnwindSafe for MsgPayload<Msg>where
Msg: RefUnwindSafe,
impl<Msg> Send for MsgPayload<Msg>where
Msg: Send,
impl<Msg> Sync for MsgPayload<Msg>where
Msg: Sync,
impl<Msg> Unpin for MsgPayload<Msg>where
Msg: Unpin,
impl<Msg> UnsafeUnpin for MsgPayload<Msg>where
Msg: UnsafeUnpin,
impl<Msg> UnwindSafe for MsgPayload<Msg>where
Msg: 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