Enum tdn::prelude::SendType[][src]

pub enum SendType {
    Connect(u64PeerVec<u8, Global>),
    Result(u64PeerboolboolVec<u8, Global>),
    Disconnect(PeerId),
    Event(u64PeerIdVec<u8, Global>),
    Stream(u32, StreamType, Vec<u8, Global>),
}
Expand description

channel message send to TDN Group.

Variants

Connect(u64PeerVec<u8, Global>)

Tuple Fields

0: u64
1: Peer
2: Vec<u8, Global>

when need stable connect to a peer, send to TDN from outside. params: delivery_id, peer and join_data.

Result(u64PeerboolboolVec<u8, Global>)

Tuple Fields

0: u64
1: Peer
2: bool
3: bool
4: 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(u64PeerIdVec<u8, Global>)

Tuple Fields

0: u64
1: PeerId
2: 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>)

Tuple Fields

0: u32
1: StreamType
2: Vec<u8, Global>

Apply for build a stream between nodes. params: u32 stream symbol, and StreamType.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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