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.

Trait Implementations§

source§

impl Debug for ReceiveMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.