logo
pub struct Routing { /* private fields */ }
Expand description

Interface for sending and receiving messages to and from other nodes, in the role of a full routing node.

A node is a part of the network that can route messages and be a member of a section or group location. Its methods can be used to send requests and responses as either an individual Node or as a part of a section or group location. Their src argument indicates that role, and can be crate::messaging::SrcLocation::Node or crate::messaging::SrcLocation::Section.

Implementations

Creates new node using the given config and bootstraps it to the network.

NOTE: It’s not guaranteed this function ever returns. This can happen due to messages being lost in transit during bootstrapping, or other reasons. It’s the responsibility of the caller to handle this case, for example by using a timeout.

Signals the Elders of our section to test connectivity to a node.

Returns the current age of this node.

Returns the ed25519 public key of this node.

Returns the ed25519 keypair of this node, as bytes.

Signs data with the ed25519 key of this node.

Signs data with the BLS secret key share of this node, if it has any. Returns Error::MissingSecretKeyShare otherwise.

Verifies signature on data with the ed25519 public key of this node.

The name of this node.

Returns connection info of this node.

Returns the Section Signed Chain

Returns the Section Chain’s genesis key

Prefix of our section

Finds out if the given XorName matches our prefix.

Returns whether the node is Elder.

Returns the information of all the current section elders.

Returns the elders of our section sorted by their distance to name (closest first).

Returns the information of all the current section adults.

Returns the adults of our section sorted by their distance to name (closest first). If we are not elder or if there are no adults in the section, returns empty vec.

Returns the info about the section matching the name.

Builds a WireMsg signed by this Node

Builds a WireMsg signed for accumulateion at destination

Send a message. Messages sent here, either section to section or node to node.

Returns the current BLS public key set if this node has one, or Error::MissingSecretKeyShare otherwise.

Returns our index in the current BLS group if this node is a member of one, or Error::MissingSecretKeyShare otherwise.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

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

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more