Enum sn_routing::Event [−][src]
pub enum Event {
MessageReceived {
content: Bytes,
src: SrcLocation,
dst: DstLocation,
signed: Option<Signed>,
section_pk: PublicKey,
},
MemberJoined {
name: XorName,
previous_name: Option<XorName>,
age: u8,
},
MemberLeft {
name: XorName,
age: u8,
},
SectionSplit {
elders: Elders,
sibling_elders: Elders,
self_status_change: NodeElderChange,
},
EldersChanged {
elders: Elders,
self_status_change: NodeElderChange,
},
RelocationStarted {
previous_name: XorName,
},
Relocated {
previous_name: XorName,
new_keypair: Arc<Keypair>,
},
RestartRequired,
ClientMsgReceived {
msg: Box<ClientMsg>,
user: EndUser,
},
ClientLost(SocketAddr),
AdultsChanged {
remaining: BTreeSet<XorName>,
added: BTreeSet<XorName>,
removed: BTreeSet<XorName>,
},
}Expand description
An Event raised by a Node or Client via its event sender.
These are sent by sn_routing to the library’s user. It allows the user to handle requests and responses, and to react to changes in the network.
Request and Response events from section locations are only raised once the majority has
been reached, i.e. enough members of the section have sent the same message.
Variants
Received a message.
Show fields
Fields of MessageReceived
content: BytesThe content of the message.
src: SrcLocationThe source location that sent the message.
dst: DstLocationThe destination location that receives the message.
signed: Option<Signed>The signed if the message was set to be aggregated at source.
section_pk: PublicKeyThe Sender’s Section PK.
A new peer joined our section.
Show fields
A node left our section.
Our section has split.
Show fields
Fields of SectionSplit
elders: EldersThe Elders of our section.
sibling_elders: EldersThe Elders of the sibling section.
self_status_change: NodeElderChangePromoted, demoted or no change?
The set of elders in our section has changed.
Show fields
Fields of EldersChanged
elders: EldersThe Elders of our section.
self_status_change: NodeElderChangePromoted, demoted or no change?
This node has started relocating to other section. Will be followed by
Relocated when the node finishes joining the destination section.
Show fields
Fields of RelocationStarted
previous_name: XorNamePrevious name before relocation
This node has completed relocation to other section.
Show fields
Disconnected or failed to connect - restart required.
Received a message from a client node.
Show fields
ClientLost(SocketAddr)Failed in sending a message to client, or connection to client is lost
Notify the current list of adult nodes, in case of churning.
Show fields
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Eventimpl UnwindSafe for Event