[][src]Enum crust::Event

pub enum Event<UID: Uid> {
    BootstrapAccept(UID, CrustUser),
    BootstrapConnect(UID, SocketAddr),
    BootstrapFailed,
    ListenerStarted(u16),
    ListenerFailed,
    ConnectionInfoPrepared(ConnectionInfoResult<UID>),
    ConnectSuccess(UID),
    ConnectFailure(UID),
    LostPeer(UID),
    NewMessage(UID, CrustUserVec<u8>),
    WriteMsgSizeProhibitive(UID, Vec<u8>),
}

Enum representing different events that will be sent over the asynchronous channel to the user of this module.

Variants

BootstrapAccept(UID, CrustUser)

Invoked when a bootstrap peer connects to us

BootstrapConnect(UID, SocketAddr)

Invoked when we bootstrap to a new peer.

BootstrapFailed

Invoked when we failed to connect to all bootstrap contacts.

ListenerStarted(u16)

Invoked when we are ready to listen for incomming connection. Contains the listening port.

ListenerFailed

Invoked when listener failed to start.

ConnectionInfoPrepared(ConnectionInfoResult<UID>)

Invoked as a result to the call of Service::prepare_contact_info.

ConnectSuccess(UID)

Invoked when connection to a new peer has been established.

ConnectFailure(UID)

Invoked when connection to a new peer has failed.

LostPeer(UID)

Invoked when a peer disconnects or can no longer be contacted.

NewMessage(UID, CrustUserVec<u8>)

Invoked when a new message is received. Passes the message.

WriteMsgSizeProhibitive(UID, Vec<u8>)

Invoked when trying to sending a too large data.

Trait Implementations

impl<UID: Debug + Uid> Debug for Event<UID>[src]

Auto Trait Implementations

impl<UID> Send for Event<UID>

impl<UID> !Sync for Event<UID>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> UnsafeAny for T where
    T: Any