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]
fn unregistered(
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx,
config: Option<BootstrapConfig>
) -> Result<Self, CoreError>
[src]
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
fn sign_pk_from_seed(seed: &str) -> Result<PublicKey, CoreError>
[src]
Calculate sign key from seed
fn registered_with_seed(
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
[src]
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.
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]
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.
fn login_with_seed(
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
[src]
seed: &str,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx
) -> Result<Client<T>, CoreError> where
T: 'static,
Login using seeded account
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]
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.
fn from_keys(
keys: ClientKeys,
owner: PublicKey,
el_handle: Handle,
core_tx: CoreMsgTx<T>,
net_tx: NetworkTx,
config: BootstrapConfig
) -> Result<Client<T>, CoreError>
[src]
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.
fn set_timeout(&self, duration: Duration)
[src]
Set request timeout.
fn restart_routing(&self) -> Result<(), CoreError>
[src]
Restart the routing client and reconnect to the network.
fn get_idata(&self, name: XorName) -> Box<CoreFuture<ImmutableData>>
[src]
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.
fn put_idata(&self, data: ImmutableData) -> Box<CoreFuture<()>>
[src]
Put immutable data onto the network.
fn put_mdata(&self, data: MutableData) -> Box<CoreFuture<()>>
[src]
Put MutableData
onto the network.
fn mutate_mdata_entries(
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<CoreFuture<()>>
[src]
&self,
name: XorName,
tag: u64,
actions: BTreeMap<Vec<u8>, EntryAction>
) -> Box<CoreFuture<()>>
Mutates MutableData
entries in bulk.
fn get_mdata(&self, name: XorName, tag: u64) -> Box<CoreFuture<MutableData>>
[src]
Get entire MutableData
from the network.
fn get_mdata_shell(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<MutableData>>
[src]
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<MutableData>>
Get a shell (bare bones) version of MutableData
from the network.
fn get_mdata_version(&self, name: XorName, tag: u64) -> Box<CoreFuture<u64>>
[src]
Get a current version of MutableData
from the network.
fn list_mdata_entries(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<Vec<u8>, Value>>>
[src]
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<Vec<u8>, Value>>>
Returns a complete list of entries in MutableData
.
fn list_mdata_keys(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeSet<Vec<u8>>>>
[src]
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeSet<Vec<u8>>>>
Returns a list of keys in MutableData
stored on the network
fn list_mdata_values(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<Vec<Value>>>
[src]
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<Vec<Value>>>
Returns a list of keys in MutableData
stored on the network
fn get_mdata_value(
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<CoreFuture<Value>>
[src]
&self,
name: XorName,
tag: u64,
key: Vec<u8>
) -> Box<CoreFuture<Value>>
Get a single entry from MutableData
fn get_account_info(&self) -> Box<CoreFuture<AccountInfo>>
[src]
Get data from the network.
fn list_mdata_permissions(
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<User, PermissionSet>>>
[src]
&self,
name: XorName,
tag: u64
) -> Box<CoreFuture<BTreeMap<User, PermissionSet>>>
Returns a list of permissions in MutableData
stored on the network
fn list_mdata_user_permissions(
&self,
name: XorName,
tag: u64,
user: User
) -> Box<CoreFuture<PermissionSet>>
[src]
&self,
name: XorName,
tag: u64,
user: User
) -> Box<CoreFuture<PermissionSet>>
Returns 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<CoreFuture<()>>
[src]
&self,
name: XorName,
tag: u64,
user: User,
permissions: PermissionSet,
version: u64
) -> Box<CoreFuture<()>>
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<CoreFuture<()>>
[src]
&self,
name: XorName,
tag: u64,
user: User,
version: u64
) -> Box<CoreFuture<()>>
Deletes a permission set for a given user
fn change_mdata_owner(
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<CoreFuture<()>>
[src]
&self,
name: XorName,
tag: u64,
new_owner: PublicKey,
version: u64
) -> Box<CoreFuture<()>>
Sends an ownership transfer request
fn list_auth_keys_and_version(
&self
) -> Box<CoreFuture<(BTreeSet<PublicKey>, u64)>>
[src]
&self
) -> Box<CoreFuture<(BTreeSet<PublicKey>, u64)>>
Fetches a list of authorised keys and version in MaidManager
fn ins_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>
[src]
Adds a new authorised key to MaidManager
fn del_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>
[src]
Removes an authorised key from MaidManager
fn set_std_dirs_created(&self, val: bool) -> Result<(), CoreError>
[src]
Sets the current status of std/root dirs creation
fn std_dirs_created(&self) -> Result<bool, CoreError>
[src]
Returns the current status of std/root dirs creation
fn set_access_container(&self, dir: MDataInfo) -> Result<bool, CoreError>
[src]
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.
fn access_container(&self) -> Result<MDataInfo, CoreError>
[src]
Get User's Access Container if available in account packet used for current login
fn set_config_root_dir(&self, dir: MDataInfo) -> Result<bool, CoreError>
[src]
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.
fn config_root_dir(&self) -> Result<MDataInfo, CoreError>
[src]
Get Maidsafe specific configuration's Root Directory ID if available in account packet used for current login
fn public_encryption_key(&self) -> Result<PublicKey, CoreError>
[src]
Returns the public encryption key
fn secret_encryption_key(&self) -> Result<SecretKey, CoreError>
[src]
Returns the Secret encryption key
fn encryption_keypair(&self) -> Result<(PublicKey, SecretKey), CoreError>
[src]
Returns the public and secret encryption keys.
fn public_signing_key(&self) -> Result<PublicKey, CoreError>
[src]
Returns the Public Signing key
fn secret_signing_key(&self) -> Result<SecretKey, CoreError>
[src]
Returns the Secret Signing key
fn secret_symmetric_key(&self) -> Result<Key, CoreError>
[src]
Returns the Symmetric Encryption key
fn signing_keypair(&self) -> Result<(PublicKey, SecretKey), CoreError>
[src]
Returns the public and secret signing keys.
fn owner_key(&self) -> Result<PublicKey, CoreError>
[src]
Return the owner signing key
fn bootstrap_config() -> Result<BootstrapConfig, CoreError>
[src]
Returns the crust::Config
associated with the crust::Service
(if any).
fn update_account_packet(&self) -> Box<CoreFuture<()>>
[src]
Updates user's account packet
Trait Implementations
impl<T> Clone for Client<T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more