Enum tdn::prelude::NetworkType [−][src]
pub enum NetworkType {
Connect(Peer),
DisConnect(Peer),
Broadcast(Broadcast, Vec<u8, Global>),
NetworkState(StateRequest, Sender<StateResponse>),
NetworkReboot,
}
Expand description
channel message send to chamomile network.
Variants
Connect(Peer)
Tuple Fields
0: Peer
when outside want to add a peer to bootstrap and DHT.
if connected, TDN will add it to boostrap and DHT.
params: peer
.
DisConnect(Peer)
Tuple Fields
0: Peer
when outside donnot want to remove peer. use it to force close.
params: Peer(socket)
.
Broadcast(Broadcast, Vec<u8, Global>)
when need broadcast a data to all network, TDN support some
common algorithm, use it, donnot worry.
params: broadcast_type
and data_bytes
NetworkState(StateRequest, Sender<StateResponse>)
Request for return the network current state info. params: request type, and return channel’s sender (async).
NetworkReboot
When receive ReceiveMessage::NetworkLost
, want to reboot network, it can use.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for NetworkType
impl Send for NetworkType
impl Sync for NetworkType
impl Unpin for NetworkType
impl !UnwindSafe for NetworkType
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more