Struct safe_core::Client [−][src]
pub struct Client<T> { /* fields omitted */ }
The main self-authentication client instance that will interface all the request from high level API's to the actual routing layer and manage all interactions with it. This is essentially a non-blocking Client with an asynchronous API using the futures abstraction from the futures-rs crate
Methods
impl<T: 'static> Client<T>
[src]
impl<T: 'static> Client<T>
pub fn unregistered(
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx,
config: Option<BootstrapConfig>
) -> Result<Self, CoreError>
[src]
pub fn unregistered(
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx,
config: Option<BootstrapConfig>
) -> Result<Self, CoreError>
This is a getter-only Gateway function to the Maidsafe network. It will create an unregistered random client, which can do very limited set of operations - eg., a Network-Get
pub fn sign_pk_from_seed(seed: &str) -> Result<PublicKey, CoreError>
[src]
pub fn sign_pk_from_seed(seed: &str) -> Result<PublicKey, CoreError>
Calculate sign key from seed
pub fn registered_with_seed(
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
[src]
pub fn registered_with_seed(
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
This is one of the Gateway functions to the Maidsafe network, the others being
unregistered
, registered
, and login
. This will help create an account given a seed.
Everything including both account secrets and all MAID keys will be deterministically
derived from the supplied seed, so this seed needs to be strong. For ordinary users, it's
recommended to use the normal registered
function where the secrets can be what's easy
to remember for the user while also being strong.
pub fn registered(
acc_locator: &str,
acc_password: &str,
invitation: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
[src]
pub fn registered(
acc_locator: &str,
acc_password: &str,
invitation: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
This is a Gateway function to the Maidsafe network. This will help create a fresh acc for the user in the SAFE-network.
pub fn login_with_seed(
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
[src]
pub fn login_with_seed(
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
Login using seeded account
pub fn login(
acc_locator: &str,
acc_password: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
[src]
pub fn login(
acc_locator: &str,
acc_password: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
This is a Gateway function to the Maidsafe network. This will help login to an already existing account of the user in the SAFE-network.
pub fn from_keys(
keys: ClientKeys,
owner: PublicKey,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx,
config: BootstrapConfig
) -> Result<Client<T>, CoreError>
[src]
pub fn from_keys(
keys: ClientKeys,
owner: PublicKey,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx,
config: BootstrapConfig
) -> Result<Client<T>, CoreError>
This is a Gateway function to the Maidsafe network. This will help apps to authorise using an existing pair of keys.
pub fn set_timeout(&self, duration: Duration)
[src]
pub fn set_timeout(&self, duration: Duration)
Set request timeout.
pub fn restart_routing(&self) -> Result<(), CoreError>
[src]
pub fn restart_routing(&self) -> Result<(), CoreError>
Restart the routing client and reconnect to the network.
ⓘImportant traits for Box<R>pub fn get_idata(&self, name: XorName) -> Box<CoreFuture<ImmutableData>>
[src]
pub fn get_idata(&self, name: XorName) -> Box<CoreFuture<ImmutableData>>
Get immutable data from the network. If the data exists locally in the cache then it will be immediately be returned without making an actual network request.
ⓘImportant traits for Box<R>pub fn put_idata(&self, data: ImmutableData) -> Box<CoreFuture<()>>
[src]
pub fn put_idata(&self, data: ImmutableData) -> Box<CoreFuture<()>>
Put immutable data onto the network.
ⓘImportant traits for Box<R>pub fn put_mdata(&self, data: MutableData) -> Box<CoreFuture<()>>
[src]
pub fn put_mdata(&self, data: MutableData) -> Box<CoreFuture<()>>
Put MutableData
onto the network.
ⓘImportant traits for Box<R>pub fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<CoreFuture<()>>
[src]
pub fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<CoreFuture<()>>
Mutates MutableData
entries in bulk.
ⓘImportant traits for Box<R>pub fn get_mdata(&self, name: XorName, tag: u64) -> Box<CoreFuture<MutableData>>
[src]
pub fn get_mdata(&self, name: XorName, tag: u64) -> Box<CoreFuture<MutableData>>
Get entire MutableData
from the network.
ⓘImportant traits for Box<R>pub fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<MutableData>>
[src]
pub fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<MutableData>>
Get a shell (bare bones) version of MutableData
from the network.
ⓘImportant traits for Box<R>pub fn get_mdata_version(&self, name: XorName, tag: u64) -> Box<CoreFuture<u64>>
[src]
pub fn get_mdata_version(&self, name: XorName, tag: u64) -> Box<CoreFuture<u64>>
Get a current version of MutableData
from the network.
ⓘImportant traits for Box<R>pub fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<Vec<u8>, Value>>>
[src]
pub fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<Vec<u8>, Value>>>
Returns a complete list of entries in MutableData
.
ⓘImportant traits for Box<R>pub fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeSet<Vec<u8>>>>
[src]
pub fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeSet<Vec<u8>>>>
Returns a list of keys in MutableData
stored on the network
ⓘImportant traits for Box<R>pub fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<Vec<Value>>>
[src]
pub fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<Vec<Value>>>
Returns a list of keys in MutableData
stored on the network
ⓘImportant traits for Box<R>pub fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<CoreFuture<Value>>
[src]
pub fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<CoreFuture<Value>>
Get a single entry from MutableData
ⓘImportant traits for Box<R>pub fn get_account_info(&self) -> Box<CoreFuture<AccountInfo>>
[src]
pub fn get_account_info(&self) -> Box<CoreFuture<AccountInfo>>
Get data from the network.
ⓘImportant traits for Box<R>pub fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<User, PermissionSet>>>
[src]
pub fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<User, PermissionSet>>>
Returns a list of permissions in MutableData
stored on the network
ⓘImportant traits for Box<R>pub fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<CoreFuture<PermissionSet>>
[src]
pub fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<CoreFuture<PermissionSet>>
Returns a list of permissions for a particular User in MutableData
ⓘImportant traits for Box<R>pub fn set_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<CoreFuture<()>>
[src]
pub fn set_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<CoreFuture<()>>
Updates or inserts a permission set for a given user
ⓘImportant traits for Box<R>pub fn del_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<CoreFuture<()>>
[src]
pub fn del_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<CoreFuture<()>>
Deletes a permission set for a given user
ⓘImportant traits for Box<R>pub fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<CoreFuture<()>>
[src]
pub fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<CoreFuture<()>>
Sends an ownership transfer request
ⓘImportant traits for Box<R>pub fn list_auth_keys_and_version(
&self
) -> Box<CoreFuture<(BTreeSet<PublicKey>, u64)>>
[src]
pub fn list_auth_keys_and_version(
&self
) -> Box<CoreFuture<(BTreeSet<PublicKey>, u64)>>
Fetches a list of authorised keys and version in MaidManager
ⓘImportant traits for Box<R>pub fn ins_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>
[src]
pub fn ins_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>
Adds a new authorised key to MaidManager
ⓘImportant traits for Box<R>pub fn del_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>
[src]
pub fn del_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>
Removes an authorised key from MaidManager
pub fn set_std_dirs_created(&self, val: bool) -> Result<(), CoreError>
[src]
pub fn set_std_dirs_created(&self, val: bool) -> Result<(), CoreError>
Sets the current status of std/root dirs creation
pub fn std_dirs_created(&self) -> Result<bool, CoreError>
[src]
pub fn std_dirs_created(&self) -> Result<bool, CoreError>
Returns the current status of std/root dirs creation
pub fn set_access_container(&self, dir: MDataInfo) -> Result<bool, CoreError>
[src]
pub fn set_access_container(&self, dir: MDataInfo) -> Result<bool, CoreError>
Replaces the config root reference in the account packet.
Returns false
if it wasn't updated.
Doesn't actually modify the session packet - you should call
update_account_packet
afterwards to actually update it on the
network.
pub fn access_container(&self) -> Result<MDataInfo, CoreError>
[src]
pub fn access_container(&self) -> Result<MDataInfo, CoreError>
Get User's Access Container if available in account packet used for current login
pub fn set_config_root_dir(&self, dir: MDataInfo) -> Result<bool, CoreError>
[src]
pub fn set_config_root_dir(&self, dir: MDataInfo) -> Result<bool, CoreError>
Replaces the config root reference in the account packet.
Returns false
if it wasn't updated.
Doesn't actually modify the session packet - you should call
update_account_packet
afterwards to actually update it on the
network.
pub fn config_root_dir(&self) -> Result<MDataInfo, CoreError>
[src]
pub fn config_root_dir(&self) -> Result<MDataInfo, CoreError>
Get Maidsafe specific configuration's Root Directory ID if available in account packet used for current login
pub fn public_encryption_key(&self) -> Result<PublicKey, CoreError>
[src]
pub fn public_encryption_key(&self) -> Result<PublicKey, CoreError>
Returns the public encryption key
pub fn secret_encryption_key(&self) -> Result<SecretKey, CoreError>
[src]
pub fn secret_encryption_key(&self) -> Result<SecretKey, CoreError>
Returns the Secret encryption key
pub fn encryption_keypair(&self) -> Result<(PublicKey, SecretKey), CoreError>
[src]
pub fn encryption_keypair(&self) -> Result<(PublicKey, SecretKey), CoreError>
Returns the public and secret encryption keys.
pub fn public_signing_key(&self) -> Result<PublicKey, CoreError>
[src]
pub fn public_signing_key(&self) -> Result<PublicKey, CoreError>
Returns the Public Signing key
pub fn secret_signing_key(&self) -> Result<SecretKey, CoreError>
[src]
pub fn secret_signing_key(&self) -> Result<SecretKey, CoreError>
Returns the Secret Signing key
pub fn secret_symmetric_key(&self) -> Result<Key, CoreError>
[src]
pub fn secret_symmetric_key(&self) -> Result<Key, CoreError>
Returns the Symmetric Encryption key
pub fn signing_keypair(&self) -> Result<(PublicKey, SecretKey), CoreError>
[src]
pub fn signing_keypair(&self) -> Result<(PublicKey, SecretKey), CoreError>
Returns the public and secret signing keys.
pub fn owner_key(&self) -> Result<PublicKey, CoreError>
[src]
pub fn owner_key(&self) -> Result<PublicKey, CoreError>
Return the owner signing key
pub fn bootstrap_config() -> Result<BootstrapConfig, CoreError>
[src]
pub fn bootstrap_config() -> Result<BootstrapConfig, CoreError>
Returns the crust::Config
associated with the crust::Service
(if any).
ⓘImportant traits for Box<R>pub fn update_account_packet(&self) -> Box<CoreFuture<()>>
[src]
pub fn update_account_packet(&self) -> Box<CoreFuture<()>>
Updates user's account packet
Trait Implementations
impl<T> Clone for Client<T>
[src]
impl<T> Clone for Client<T>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Debug for Client<T>
[src]
impl<T> Debug for Client<T>