Enum crust::Event
[−]
[src]
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, CrustUser, Vec<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, CrustUser, Vec<u8>)
Invoked when a new message is received. Passes the message.
WriteMsgSizeProhibitive(UID, Vec<u8>)
Invoked when trying to sending a too large data.