Enum tdn::prelude::SendType [−][src]
pub enum SendType {
Connect(u64, Peer, Vec<u8, Global>),
Result(u64, Peer, bool, bool, Vec<u8, Global>),
Disconnect(PeerId),
Event(u64, PeerId, Vec<u8, Global>),
Stream(u32, StreamType, Vec<u8, Global>),
}
Expand description
channel message send to TDN Group.
Variants
Connect(u64, Peer, Vec<u8, Global>)
when need stable connect to a peer, send to TDN from outside.
params: delivery_id
, peer
and join_data
.
Result(u64, Peer, bool, bool, Vec<u8, Global>)
when peer request for stable, outside decide connect or not.
params: delivery_id
, peer_id
, is_connect
, is_force_close
, result_data
.
if is_connect
is true, it will add to allow directly list.
we want to build a better network, add a is_force_close
.
if is_connect
is false, but is_force_close
if true, we
will use this peer to build our DHT for better connection.
if false, we will force close it.
Disconnect(PeerId)
Tuple Fields
0: PeerId
when outside want to close a connectioned peer. use it force close.
params: peer_id
.
Event(u64, PeerId, Vec<u8, Global>)
when need send a data to a peer, only need know the peer_id,
the TDN will help you send data to there.
params: delivery_id
, peer_id
, data_bytes
.
Stream(u32, StreamType, Vec<u8, Global>)
Apply for build a stream between nodes.
params: u32
stream symbol, and StreamType
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SendType
impl !UnwindSafe for SendType
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