Struct routing::Node
[−]
[src]
pub struct Node { // some 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 member of a group authority. Its
methods can be used to send requests and responses as either an individual ManagedNode
or as
a part of a group authority. Their src
argument indicates that role, so it must always either
be the ManagedNode
with this node's name, or the ClientManager
or NodeManager
or
NaeManager
with the address of a client, node or data element that this node is close to.
Methods
impl Node
[src]
fn builder() -> NodeBuilder
Creates a new builder to configure and create a Node
.
fn send_get_request(&self, src: Authority, dst: Authority, data_request: DataIdentifier, id: MessageId) -> Result<(), InterfaceError>
Send a Get
request to dst
to retrieve data from the network.
fn send_put_request(&self, src: Authority, dst: Authority, data: Data, id: MessageId) -> Result<(), InterfaceError>
Send a Put
request to dst
to store data on the network.
fn send_post_request(&self, src: Authority, dst: Authority, data: Data, id: MessageId) -> Result<(), InterfaceError>
Send a Post
request to dst
to modify data on the network.
fn send_delete_request(&self, src: Authority, dst: Authority, data: Data, id: MessageId) -> Result<(), InterfaceError>
Send a Delete
request to dst
to remove data from the network.
fn send_get_success(&self, src: Authority, dst: Authority, data: Data, id: MessageId) -> Result<(), InterfaceError>
Respond to a Get
request indicating success and sending the requested data.
fn send_get_failure(&self, src: Authority, dst: Authority, data_id: DataIdentifier, external_error_indicator: Vec<u8>, id: MessageId) -> Result<(), InterfaceError>
Respond to a Get
request indicating failure.
fn send_put_success(&self, src: Authority, dst: Authority, name: DataIdentifier, id: MessageId) -> Result<(), InterfaceError>
Respond to a Put
request indicating success.
fn send_put_failure(&self, src: Authority, dst: Authority, data_id: DataIdentifier, external_error_indicator: Vec<u8>, id: MessageId) -> Result<(), InterfaceError>
Respond to a Put
request indicating failure.
fn send_post_success(&self, src: Authority, dst: Authority, name: DataIdentifier, id: MessageId) -> Result<(), InterfaceError>
Respond to a Post
request indicating success.
fn send_post_failure(&self, src: Authority, dst: Authority, data_id: DataIdentifier, external_error_indicator: Vec<u8>, id: MessageId) -> Result<(), InterfaceError>
Respond to a Post
request indicating failure.
fn send_delete_success(&self, src: Authority, dst: Authority, name: DataIdentifier, id: MessageId) -> Result<(), InterfaceError>
Respond to a Delete
request indicating success.
fn send_delete_failure(&self, src: Authority, dst: Authority, data_id: DataIdentifier, external_error_indicator: Vec<u8>, id: MessageId) -> Result<(), InterfaceError>
Respond to a Delete
request indicating failure.
fn send_get_account_info_success(&self, src: Authority, dst: Authority, data_stored: u64, space_available: u64, id: MessageId) -> Result<(), InterfaceError>
Respond to a GetAccountInfo
request indicating success.
fn send_get_account_info_failure(&self, src: Authority, dst: Authority, external_error_indicator: Vec<u8>, id: MessageId) -> Result<(), InterfaceError>
Respond to a GetAccountInfo
request indicating failure.
fn send_refresh_request(&self, src: Authority, dst: Authority, content: Vec<u8>, id: MessageId) -> Result<(), InterfaceError>
Send a Refresh
request from src
to dst
to trigger churn.
fn close_group(&self, name: XorName) -> Result<Option<Vec<XorName>>, InterfaceError>
Returns the names of the nodes in the routing table which are closest to the given one.
fn name(&self) -> Result<XorName, InterfaceError>
Returns the name of this node.
fn quorum_size(&self) -> Result<usize, InterfaceError>
Returns the name of this node.