Enum chamomile_types::message::ReceiveMessage
source · pub enum ReceiveMessage {
StableConnect(Peer, Vec<u8>),
StableResult(Peer, bool, Vec<u8>),
ResultConnect(Peer, Vec<u8>),
StableLeave(Peer),
Data(PeerId, Vec<u8>),
Stream(u32, StreamType, Vec<u8>),
Delivery(DeliveryType, u64, bool, Vec<u8>),
NetworkLost,
OwnConnect(Peer),
OwnLeave(Peer),
OwnEvent(PeerId, Vec<u8>),
}
Expand description
main received message for outside channel, send from chamomile to outside.
Variants§
StableConnect(Peer, Vec<u8>)
when peer what to stable connect, send from chamomile to outside.
params is peer
and connect_info
.
StableResult(Peer, bool, Vec<u8>)
when peer get stable connect result.
params is peer
, is_ok
and result_data
.
ResultConnect(Peer, Vec<u8>)
when peer want to response a stable result, but the session is closed, if stable result is ok, then need create a result connect to sender. the data type is stable result data type.
StableLeave(Peer)
when a stable connection’s peer leave,
send from chamomile to outside.
params is peer
.
Data(PeerId, Vec<u8>)
when received a data from a trusted peer,
send to outside.
params is peer_id
and data_bytes
.
Stream(u32, StreamType, Vec<u8>)
(Only stable connected) Apply for build a stream between nodes.
params is u32
stream symbol, and StreamType
.
Delivery(DeliveryType, u64, bool, Vec<u8>)
(Only stable connected) Delivery feedback. include StableConnect, StableResult, Data. id(u32) != 0
.
NetworkLost
when network lost all DHT network and direct stables. will tell outside.
OwnConnect(Peer)
when same PeerId peer is connected. this peer.id is assist_id.
OwnLeave(Peer)
when same PeerId is leaved. this peer.id is assist_id.
OwnEvent(PeerId, Vec<u8>)
when receive same PeerId message.
params is assist_id
and data_bytes
.