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.
Starts a proposal that a node has gone offline. This can be done only by an Elder.
Signals the Elders of our section to test connectivity to a 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.
Returns connection info of this node.
Returns the Section Signed Chain
Prefix of our section
Finds out if the given XorName matches our prefix.
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 our section’s authority provider.
Returns the info about other sections in the network known to us.
Returns the info about the section matching the name.
pub async fn sign_single_src_msg(
&self,
node_msg: NodeMsg,
dst: DstLocation
) -> Result<WireMsg>
pub async fn sign_single_src_msg(
&self,
node_msg: NodeMsg,
dst: DstLocation
) -> Result<WireMsg>
Builds a WireMsg signed by this Node
pub async fn sign_msg_for_dst_accumulation(
&self,
node_msg: NodeMsg,
dst: DstLocation
) -> Result<WireMsg>
pub async fn sign_msg_for_dst_accumulation(
&self,
node_msg: NodeMsg,
dst: DstLocation
) -> Result<WireMsg>
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.
Auto Trait Implementations
impl !RefUnwindSafe for Routing
impl !UnwindSafe for Routing
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self