Trait safe_app::Client [−][src]
pub trait Client: 'static + Clone { type MsgType; fn full_id(&self) -> Option<FullId>; fn config(&self) -> Option<Config>; fn cm_addr(&self) -> Option<Authority<XorName>>; fn inner(&self) -> Rc<RefCell<ClientInner<Self, Self::MsgType>>>; fn public_encryption_key(&self) -> Option<PublicKey>; fn secret_encryption_key(&self) -> Option<SecretKey>; fn secret_symmetric_key(&self) -> Option<Key>; fn public_signing_key(&self) -> Option<PublicKey>; fn secret_signing_key(&self) -> Option<SecretKey>; fn owner_key(&self) -> Option<PublicKey>; fn encryption_keypair(&self) -> Option<(PublicKey, SecretKey)> { ... } fn signing_keypair(&self) -> Option<(PublicKey, SecretKey)> { ... } fn set_timeout(&self, duration: Duration) { ... } fn restart_routing(&self) -> Result<(), CoreError> { ... } fn get_idata(
&self,
name: XorName
) -> Box<Future<Item = ImmutableData, Error = CoreError> + 'static> { ... } fn put_idata(
&self,
data: ImmutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn put_mdata(
&self,
data: MutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn get_mdata(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static> { ... } fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static> { ... } fn get_mdata_version(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = u64, Error = CoreError> + 'static> { ... } fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<Vec<u8>, Value>, Error = CoreError> + 'static> { ... } fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeSet<Vec<u8>>, Error = CoreError> + 'static> { ... } fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = Vec<Value>, Error = CoreError> + 'static> { ... } fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<Future<Item = Value, Error = CoreError> + 'static> { ... } fn get_account_info(
&self
) -> Box<Future<Item = AccountInfo, Error = CoreError> + 'static> { ... } fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<User, PermissionSet>, Error = CoreError> + 'static> { ... } fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<Future<Item = PermissionSet, Error = CoreError> + 'static> { ... } fn set_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn del_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn list_auth_keys_and_version(
&self
) -> Box<Future<Item = (BTreeSet<PublicKey>, u64), Error = CoreError> + 'static> { ... } fn ins_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } fn del_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static> { ... } }
Trait providing an interface for self-authentication client implementations, so they can interface all requests from high level API's to the actual routing layer and manage all interactions with it. Essentially provides an interface for non-blocking Clients with an asynchronous API using the futures abstraction from the futures-rs crate.
Associated Types
type MsgType
Associated message type.
Required Methods
fn full_id(&self) -> Option<FullId>
Return the client's ID.
fn config(&self) -> Option<Config>
Return a crust::Config
if the Client
was initialized with one.
fn cm_addr(&self) -> Option<Authority<XorName>>
Address of the Client Manager.
fn inner(&self) -> Rc<RefCell<ClientInner<Self, Self::MsgType>>>
Return an associated ClientInner
type which is expected to contain fields associated with
the implementing type.
fn public_encryption_key(&self) -> Option<PublicKey>
Return the public encryption key.
fn secret_encryption_key(&self) -> Option<SecretKey>
Return the Secret encryption key.
fn secret_symmetric_key(&self) -> Option<Key>
Return the Symmetric Encryption key.
fn public_signing_key(&self) -> Option<PublicKey>
Return the Public Signing key.
fn secret_signing_key(&self) -> Option<SecretKey>
Return the Secret Signing key.
fn owner_key(&self) -> Option<PublicKey>
Return the owner signing key.
Provided Methods
fn encryption_keypair(&self) -> Option<(PublicKey, SecretKey)>
Return the public and secret encryption keys.
fn signing_keypair(&self) -> Option<(PublicKey, SecretKey)>
Return the public and secret signing keys.
fn set_timeout(&self, duration: Duration)
Set request timeout.
fn restart_routing(&self) -> Result<(), CoreError>
Restart the routing client and reconnect to the network.
fn get_idata(
&self,
name: XorName
) -> Box<Future<Item = ImmutableData, Error = CoreError> + 'static>
&self,
name: XorName
) -> Box<Future<Item = ImmutableData, Error = CoreError> + 'static>
Get immutable data from the network. If the data exists locally in the cache then it will be immediately returned without making an actual network request.
fn put_idata(
&self,
data: ImmutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
data: ImmutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Put immutable data onto the network.
fn put_mdata(
&self,
data: MutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
data: MutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Put MutableData
onto the network.
fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Mutates MutableData
entries in bulk.
fn get_mdata(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
Get entire MutableData
from the network.
fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
Get a shell (bare bones) version of MutableData
from the network.
fn get_mdata_version(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = u64, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = u64, Error = CoreError> + 'static>
Get a current version of MutableData
from the network.
fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<Vec<u8>, Value>, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<Vec<u8>, Value>, Error = CoreError> + 'static>
Return a complete list of entries in MutableData
.
fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeSet<Vec<u8>>, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeSet<Vec<u8>>, Error = CoreError> + 'static>
Return a list of keys in MutableData
stored on the network.
fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = Vec<Value>, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = Vec<Value>, Error = CoreError> + 'static>
Return a list of keys in MutableData
stored on the network.
fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<Future<Item = Value, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<Future<Item = Value, Error = CoreError> + 'static>
Get a single entry from MutableData
.
fn get_account_info(
&self
) -> Box<Future<Item = AccountInfo, Error = CoreError> + 'static>
&self
) -> Box<Future<Item = AccountInfo, Error = CoreError> + 'static>
Get data from the network.
fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<User, PermissionSet>, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<User, PermissionSet>, Error = CoreError> + 'static>
Return a list of permissions in MutableData
stored on the network.
fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<Future<Item = PermissionSet, Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64,
user: User
) -> Box<Future<Item = PermissionSet, Error = CoreError> + 'static>
Return a list of permissions for a particular User in MutableData.
fn set_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Updates or inserts a permission set for a given user
fn del_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Deletes a permission set for a given user
fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Sends an ownership transfer request.
fn list_auth_keys_and_version(
&self
) -> Box<Future<Item = (BTreeSet<PublicKey>, u64), Error = CoreError> + 'static>
&self
) -> Box<Future<Item = (BTreeSet<PublicKey>, u64), Error = CoreError> + 'static>
Fetches a list of authorised keys and version in MaidManager.
fn ins_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Adds a new authorised key to MaidManager.
fn del_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Removes an authorised key from MaidManager.
Implementations on Foreign Types
impl Client for CoreClient
[src]
impl Client for CoreClient
type MsgType = ()
fn full_id(&self) -> Option<FullId>
[src]
fn full_id(&self) -> Option<FullId>
fn config(&self) -> Option<Config>
[src]
fn config(&self) -> Option<Config>
fn cm_addr(&self) -> Option<Authority<XorName>>
[src]
fn cm_addr(&self) -> Option<Authority<XorName>>
fn inner(
&self
) -> Rc<RefCell<ClientInner<CoreClient, <CoreClient as Client>::MsgType>>>
[src]
fn inner(
&self
) -> Rc<RefCell<ClientInner<CoreClient, <CoreClient as Client>::MsgType>>>
fn public_encryption_key(&self) -> Option<PublicKey>
[src]
fn public_encryption_key(&self) -> Option<PublicKey>
fn secret_encryption_key(&self) -> Option<SecretKey>
[src]
fn secret_encryption_key(&self) -> Option<SecretKey>
fn public_signing_key(&self) -> Option<PublicKey>
[src]
fn public_signing_key(&self) -> Option<PublicKey>
fn secret_signing_key(&self) -> Option<SecretKey>
[src]
fn secret_signing_key(&self) -> Option<SecretKey>
fn secret_symmetric_key(&self) -> Option<Key>
[src]
fn secret_symmetric_key(&self) -> Option<Key>
fn owner_key(&self) -> Option<PublicKey>
[src]
fn owner_key(&self) -> Option<PublicKey>
fn encryption_keypair(&self) -> Option<(PublicKey, SecretKey)>
[src]
fn encryption_keypair(&self) -> Option<(PublicKey, SecretKey)>
fn signing_keypair(&self) -> Option<(PublicKey, SecretKey)>
[src]
fn signing_keypair(&self) -> Option<(PublicKey, SecretKey)>
fn set_timeout(&self, duration: Duration)
[src]
fn set_timeout(&self, duration: Duration)
fn restart_routing(&self) -> Result<(), CoreError>
[src]
fn restart_routing(&self) -> Result<(), CoreError>
ⓘImportant traits for Box<R>fn get_idata(
&self,
name: XorName
) -> Box<Future<Item = ImmutableData, Error = CoreError> + 'static>
[src]
fn get_idata(
&self,
name: XorName
) -> Box<Future<Item = ImmutableData, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn put_idata(
&self,
data: ImmutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn put_idata(
&self,
data: ImmutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn put_mdata(
&self,
data: MutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn put_mdata(
&self,
data: MutableData
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn get_mdata(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
[src]
fn get_mdata(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
[src]
fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = MutableData, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn get_mdata_version(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = u64, Error = CoreError> + 'static>
[src]
fn get_mdata_version(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = u64, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<Vec<u8>, Value>, Error = CoreError> + 'static>
[src]
fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<Vec<u8>, Value>, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeSet<Vec<u8>>, Error = CoreError> + 'static>
[src]
fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeSet<Vec<u8>>, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = Vec<Value>, Error = CoreError> + 'static>
[src]
fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = Vec<Value>, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<Future<Item = Value, Error = CoreError> + 'static>
[src]
fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<Future<Item = Value, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn get_account_info(
&self
) -> Box<Future<Item = AccountInfo, Error = CoreError> + 'static>
[src]
fn get_account_info(
&self
) -> Box<Future<Item = AccountInfo, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<User, PermissionSet>, Error = CoreError> + 'static>
[src]
fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<Future<Item = BTreeMap<User, PermissionSet>, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<Future<Item = PermissionSet, Error = CoreError> + 'static>
[src]
fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<Future<Item = PermissionSet, Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn set_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn set_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn del_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn del_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn list_auth_keys_and_version(
&self
) -> Box<Future<Item = (BTreeSet<PublicKey>, u64), Error = CoreError> + 'static>
[src]
fn list_auth_keys_and_version(
&self
) -> Box<Future<Item = (BTreeSet<PublicKey>, u64), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn ins_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn ins_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
ⓘImportant traits for Box<R>fn del_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
[src]
fn del_auth_key(
&self,
key: PublicKey,
version: u64
) -> Box<Future<Item = (), Error = CoreError> + 'static>
Implementors
impl Client for AppClient type MsgType = AppContext;