Struct routing::Client
[−]
[src]
pub struct Client { /* 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 section authority.
Methods
impl Client
[src]
fn get_account_info(
&mut self,
dst: Authority<XorName>,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
msg_id: MessageId
) -> Result<(), InterfaceError>
Gets MAID account information.
fn put_idata(
&mut self,
dst: Authority<XorName>,
data: ImmutableData,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
data: ImmutableData,
msg_id: MessageId
) -> Result<(), InterfaceError>
Puts ImmutableData to the network
fn get_idata(
&mut self,
dst: Authority<XorName>,
name: XorName,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches ImmutableData from the network by the given name.
fn get_mdata_version(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches a latest version number of the provided MutableData
fn get_mdata_shell(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches the shell of the provided MutableData
fn get_mdata(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches the entire MutableData
fn list_mdata_entries(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches a list of entries (keys + values) of the provided MutableData Note: response to this request is unlikely to accumulate during churn.
fn list_mdata_keys(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches a list of keys of the provided MutableData Note: response to this request is unlikely to accumulate during churn.
fn list_mdata_values(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches a list of values of the provided MutableData Note: response to this request is unlikely to accumulate during churn.
fn get_mdata_value(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
key: Vec<u8>,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
key: Vec<u8>,
msg_id: MessageId
) -> Result<(), InterfaceError>
Fetches a single value from the provided MutableData by the given key
fn put_mdata(
&mut self,
dst: Authority<XorName>,
data: MutableData,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
data: MutableData,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
Creates a new MutableData
in the network
fn mutate_mdata_entries(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
Updates MutableData
entries in bulk
fn list_mdata_permissions(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Lists all permissions for a given MutableData
fn list_mdata_user_permissions(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
user: User,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
user: User,
msg_id: MessageId
) -> Result<(), InterfaceError>
Lists a permission set for a given user
fn set_mdata_user_permissions(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
Updates or inserts a permission set for a given user
fn del_mdata_user_permissions(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
user: User,
version: u64,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
user: User,
version: u64,
msg_id: MessageId,
requester: PublicKey
) -> Result<(), InterfaceError>
Deletes a permission set for a given user
fn change_mdata_owner(
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
new_owners: BTreeSet<PublicKey>,
version: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
name: XorName,
tag: u64,
new_owners: BTreeSet<PublicKey>,
version: u64,
msg_id: MessageId
) -> Result<(), InterfaceError>
Sends an ownership transfer request
fn list_auth_keys_and_version(
&mut self,
dst: Authority<XorName>,
message_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
message_id: MessageId
) -> Result<(), InterfaceError>
Fetches a list of authorised keys and version in MaidManager
fn ins_auth_key(
&mut self,
dst: Authority<XorName>,
key: PublicKey,
version: u64,
message_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
key: PublicKey,
version: u64,
message_id: MessageId
) -> Result<(), InterfaceError>
Adds a new authorised key to MaidManager
fn del_auth_key(
&mut self,
dst: Authority<XorName>,
key: PublicKey,
version: u64,
message_id: MessageId
) -> Result<(), InterfaceError>
&mut self,
dst: Authority<XorName>,
key: PublicKey,
version: u64,
message_id: MessageId
) -> Result<(), InterfaceError>
Removes an authorised key from MaidManager
impl Client
[src]
fn new(
event_sender: Sender<Event>,
keys: Option<FullId>,
bootstrap_config: Option<BootstrapConfig>,
msg_expiry_dur: Duration
) -> Result<Client, RoutingError>
event_sender: Sender<Event>,
keys: Option<FullId>,
bootstrap_config: Option<BootstrapConfig>,
msg_expiry_dur: Duration
) -> 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 section consensus. The restriction for the client name
exists to ensure that the client cannot choose its ClientAuthority
.
fn id(&self) -> Result<PublicId, InterfaceError>
Returns the PublicId
of this client.
fn bootstrap_config() -> Result<BootstrapConfig, RoutingError>
Returns the bootstrap config that this client was created with.