logo

Struct safe_network::routing::Routing[][src]

pub struct Routing { /* fields omitted */ }
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.

Sets the JoinsAllowed flag.

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.

Set the foreground color generically Read more

Set the background color generically. Read more

Change the foreground color to black

Change the foreground color to black

Change the foreground color to red

Change the foreground color to red

Change the foreground color to green

Change the foreground color to green

Change the foreground color to yellow

Change the foreground color to yellow

Change the foreground color to blue

Change the foreground color to blue

Change the foreground color to magenta

Change the foreground color to magenta

Change the foreground color to purple

Change the foreground color to purple

Change the foreground color to cyan

Change the foreground color to cyan

Change the foreground color to white

Change the foreground color to white

Change the foreground color to bright black

Change the foreground color to bright black

Change the foreground color to bright red

Change the foreground color to bright red

Change the foreground color to bright green

Change the foreground color to bright green

Change the foreground color to bright yellow

Change the foreground color to bright yellow

Change the foreground color to bright blue

Change the foreground color to bright blue

Change the foreground color to bright magenta

Change the foreground color to bright magenta

Change the foreground color to bright purple

Change the foreground color to bright purple

Change the foreground color to bright cyan

Change the foreground color to bright cyan

Change the foreground color to bright white

Change the foreground color to bright white

Make the text bold

Make the text dim

Make the text italicized

Make the text italicized

Make the text blink

Make the text blink (but fast!)

Swap the foreground and background colors

Hide the text

Cross out the text

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more

Sets the foreground color to an RGB value.

Sets the background color to an RGB value.

Apply a runtime-determined style

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