Struct routing::Client
[−]
[src]
pub struct Client { // some fields omitted }
Interface for sending and receiving messages to and from a network of nodes in the role of a client.
A client is connected to the network via one or more nodes. Messages are never routed via a client, and a client cannot be part of a group authority.
Methods
impl Client
[src]
fn new(event_sender: Sender<Event>, keys: Option<FullId>) -> Result<Client, RoutingError>
Create a new Client
.
It will automatically connect to the network, but not attempt to achieve full routing node
status. The name of the client will be the name of the PublicId
of the keys
and must
equal the SHA512 hash of its public signing key, otherwise the client will be instantly
terminated.
Keys will be exchanged with the ClientAuthority
so that communication with the network is
cryptographically secure and uses group consensus. The restriction for the client name
exists to ensure that the client cannot choose its ClientAuthority
.
fn send_get_request(&mut self, dst: Authority, data_id: DataIdentifier, message_id: MessageId) -> Result<(), InterfaceError>
Send a Get message with a DataIdentifier
to an Authority
, signed with given keys.
fn send_put_request(&self, dst: Authority, data: Data, message_id: MessageId) -> Result<(), InterfaceError>
Add something to the network
fn send_post_request(&self, dst: Authority, data: Data, message_id: MessageId) -> Result<(), InterfaceError>
Change something already on the network
fn send_delete_request(&self, dst: Authority, data: Data, message_id: MessageId) -> Result<(), InterfaceError>
Remove something from the network
fn send_append_request(&self, dst: Authority, wrapper: AppendWrapper, message_id: MessageId) -> Result<(), InterfaceError>
Append an item to appendable data.
fn send_get_account_info_request(&mut self, dst: Authority, message_id: MessageId) -> Result<(), InterfaceError>
Request account information for the Client calling this function
fn name(&self) -> Result<XorName, InterfaceError>
Returns the name of this node.