Struct routing::Node
[−]
[src]
pub struct Node { /* fields omitted */ }
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
authority. Its methods can be used to send requests and responses as either an individual
ManagedNode
or as a part of a section or group authority. Their src
argument indicates that
role, and can be any Authority
other than Client
.
Methods
impl Node
[src]
fn builder() -> NodeBuilder
Creates a new builder to configure and create a Node
.
fn send_get_request(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_request: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_request: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
Send a Get
request to dst
to retrieve data from the network.
fn send_put_request(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
Send a Put
request to dst
to store data on the network.
fn send_post_request(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
Send a Post
request to dst
to modify data on the network.
fn send_delete_request(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
Send a Delete
request to dst
to remove data from the network.
fn send_get_success(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data: Data,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Get
request indicating success and sending the requested data.
fn send_get_failure(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Get
request indicating failure.
fn send_put_success(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Put
request indicating success.
fn send_put_failure(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Put
request indicating failure.
fn send_post_success(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Post
request indicating success.
fn send_post_failure(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Post
request indicating failure.
fn send_delete_success(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Delete
request indicating success.
fn send_delete_failure(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a Delete
request indicating failure.
fn send_append_success(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
name: DataIdentifier,
id: MessageId
) -> Result<(), InterfaceError>
Respond to an Append
request indicating success.
fn send_append_failure(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_id: DataIdentifier,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Respond to an Append
request indicating failure.
fn send_get_account_info_success(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_stored: u64,
space_available: u64,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
data_stored: u64,
space_available: u64,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a GetAccountInfo
request indicating success.
fn send_get_account_info_failure(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
external_error_indicator: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Respond to a GetAccountInfo
request indicating failure.
fn send_refresh_request(
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
content: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
&mut self,
src: Authority<XorName>,
dst: Authority<XorName>,
content: Vec<u8>,
id: MessageId
) -> Result<(), InterfaceError>
Send a Refresh
request from src
to dst
to trigger churn.
fn close_group(&self, name: XorName, count: usize) -> Option<Vec<XorName>>
Returns the first count
names of the nodes in the routing table which are closest
to the given one.
fn id(&self) -> Result<PublicId, RoutingError>
Returns the PublicId
of this node.
fn routing_table(&self) -> Result<&RoutingTable<XorName>, RoutingError>
Returns the routing table of this node.