Enum sn_routing::Event[][src]

pub enum Event {
    MessageReceived {
        content: Bytes,
        src: SrcLocation,
        dst: DstLocation,
        proof: Option<Proof>,
        proof_chain: Option<SectionChain>,
    },
    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

MessageReceived
Expand description

Received a message.

Show fields

Fields of MessageReceived

content: Bytes
Expand description

The content of the message.

src: SrcLocation
Expand description

The source location that sent the message.

dst: DstLocation
Expand description

The destination location that receives the message.

proof: Option<Proof>
Expand description

The proof if the message was set to be aggregated at source.

proof_chain: Option<SectionChain>
Expand description

The proof chain for the message, if any.

MemberJoined
Expand description

A new peer joined our section.

Show fields

Fields of MemberJoined

name: XorName
Expand description

Name of the node

previous_name: Option<XorName>
Expand description

Previous name before relocation or None if it is a new node.

age: u8
Expand description

Age of the node

MemberLeft
Expand description

A node left our section.

Show fields

Fields of MemberLeft

name: XorName
Expand description

Name of the node

age: u8
Expand description

Age of the node

SectionSplit
Expand description

Our section has split.

Show fields

Fields of SectionSplit

elders: Elders
Expand description

The Elders of our section.

sibling_elders: Elders
Expand description

The Elders of the sibling section.

self_status_change: NodeElderChange
Expand description

Promoted, demoted or no change?

EldersChanged
Expand description

The set of elders in our section has changed.

Show fields

Fields of EldersChanged

elders: Elders
Expand description

The Elders of our section.

self_status_change: NodeElderChange
Expand description

Promoted, demoted or no change?

RelocationStarted
Expand description

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: XorName
Expand description

Previous name before relocation

Relocated
Expand description

This node has completed relocation to other section.

Show fields

Fields of Relocated

previous_name: XorName
Expand description

Old name before the relocation.

new_keypair: Arc<Keypair>
Expand description

New keypair to be used after relocation.

RestartRequired
Expand description

Disconnected or failed to connect - restart required.

ClientMsgReceived
Expand description

Received a message from a client node.

Show fields

Fields of ClientMsgReceived

msg: Box<ClientMsg>
Expand description

The content of the message.

user: EndUser
Expand description

The SocketAddr and PublicKey that sent the message. (Note: socket_id will be a random hash, to map against the actual socketaddr)

ClientLost(SocketAddr)
Expand description

Failed in sending a message to client, or connection to client is lost

AdultsChanged
Expand description

Notify the current list of adult nodes, in case of churning.

Show fields

Fields of AdultsChanged

remaining: BTreeSet<XorName>
Expand description

Remaining Adults in our section.

added: BTreeSet<XorName>
Expand description

New Adults in our section.

removed: BTreeSet<XorName>
Expand description

Removed Adults in our section.

Trait Implementations

impl Debug for Event[src]

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl RefUnwindSafe for Event

impl Send for Event

impl Sync for Event

impl Unpin for Event

impl UnwindSafe for Event

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V