[][src]Struct safe_core::client::core_client::CoreClient

pub struct CoreClient { /* fields omitted */ }

Barebones Client object used for testing purposes.

Methods

impl CoreClient[src]

pub fn new(
    acc_locator: &str,
    acc_password: &str,
    el_handle: Handle,
    core_tx: CoreMsgTx<Self, ()>,
    net_tx: NetworkTx
) -> Result<Self, CoreError>
[src]

This will create a basic Client object which is sufficient only for testing purposes.

Trait Implementations

impl Client for CoreClient[src]

type MsgType = ()

Associated message type.

fn encryption_keypair(&self) -> (PublicKey, SecretKey)[src]

Return the public and secret encryption keys.

fn compose_message(&self, request: Request, sign: bool) -> Message[src]

Create a Message from the given request. This function adds the requester signature and message ID. Read more

fn signing_keypair(&self) -> (PublicKey, SecretKey)[src]

Return the public and secret signing keys.

fn set_timeout(&self, duration: Duration)[src]

Set request timeout.

fn restart_network(&self) -> Result<(), CoreError>[src]

Restart the client and reconnect to the network.

fn put_unseq_mutable_data(&self, data: UnseqMutableData) -> Box<CoreFuture<()>>[src]

Put unsequenced mutable data to the network

fn transfer_coins(
    &self,
    secret_key: Option<&BlsSecretKey>,
    destination: XorName,
    amount: Coins,
    transaction_id: Option<u64>
) -> Box<CoreFuture<Transaction>>
[src]

Transfer coin balance

fn create_balance(
    &self,
    secret_key: Option<&BlsSecretKey>,
    new_balance_owner: PublicKey,
    amount: Coins,
    transaction_id: Option<u64>
) -> Box<CoreFuture<Transaction>>
[src]

Creates a new balance on the network.

fn insert_login_packet_for(
    &self,
    secret_key: Option<&BlsSecretKey>,
    new_owner: PublicKey,
    amount: Coins,
    transaction_id: Option<u64>,
    new_login_packet: LoginPacket
) -> Box<CoreFuture<Transaction>>
[src]

Insert a given login packet at the specified destination

fn get_balance(
    &self,
    secret_key: Option<&BlsSecretKey>
) -> Box<CoreFuture<Coins>>
[src]

Get the current coin balance.

fn put_idata(&self, data: impl Into<IData>) -> Box<CoreFuture<()>>[src]

Put immutable data to the network.

fn get_idata(&self, address: IDataAddress) -> Box<CoreFuture<IData>>[src]

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. Read more

fn del_unpub_idata(&self, name: XorName) -> Box<CoreFuture<()>>[src]

Delete unpublished immutable data from the network.

fn put_seq_mutable_data(&self, data: SeqMutableData) -> Box<CoreFuture<()>>[src]

Put sequenced mutable data to the network

fn get_unseq_mdata(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<UnseqMutableData>>
[src]

Fetch unpublished mutable data from the network

fn get_seq_mdata_value(
    &self,
    name: XorName,
    tag: u64,
    key: Vec<u8>
) -> Box<CoreFuture<MDataSeqValue>>
[src]

Fetch the value for a given key in a sequenced mutable data

fn get_unseq_mdata_value(
    &self,
    name: XorName,
    tag: u64,
    key: Vec<u8>
) -> Box<CoreFuture<Vec<u8>>>
[src]

Fetch the value for a given key in a sequenced mutable data

fn get_seq_mdata(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<SeqMutableData>>
[src]

Fetch sequenced mutable data from the network

fn mutate_seq_mdata_entries(
    &self,
    name: XorName,
    tag: u64,
    actions: MDataSeqEntryActions
) -> Box<CoreFuture<()>>
[src]

Mutates sequenced MutableData entries in bulk

fn mutate_unseq_mdata_entries(
    &self,
    name: XorName,
    tag: u64,
    actions: MDataUnseqEntryActions
) -> Box<CoreFuture<()>>
[src]

Mutates unsequenced MutableData entries in bulk

fn get_seq_mdata_shell(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<SeqMutableData>>
[src]

Get a shell (bare bones) version of MutableData from the network.

fn get_unseq_mdata_shell(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<UnseqMutableData>>
[src]

Get a shell (bare bones) version of MutableData from the network.

fn get_mdata_version(&self, address: MDataAddress) -> Box<CoreFuture<u64>>[src]

Get a current version of MutableData from the network.

fn list_unseq_mdata_entries(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<BTreeMap<Vec<u8>, Vec<u8>>>>
[src]

Return a complete list of entries in MutableData.

fn list_seq_mdata_entries(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<MDataSeqEntries>>
[src]

Return a complete list of entries in MutableData.

fn list_mdata_keys(
    &self,
    address: MDataAddress
) -> Box<CoreFuture<BTreeSet<Vec<u8>>>>
[src]

Return a list of keys in MutableData stored on the network.

fn list_seq_mdata_values(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<Vec<MDataSeqValue>>>
[src]

Return a list of values in a Sequenced Mutable Data

fn list_mdata_user_permissions(
    &self,
    address: MDataAddress,
    user: PublicKey
) -> Box<CoreFuture<MDataPermissionSet>>
[src]

Return the permissions set for a particular user

fn list_unseq_mdata_values(
    &self,
    name: XorName,
    tag: u64
) -> Box<CoreFuture<Vec<Vec<u8>>>>
[src]

Returns a list of values in an Unsequenced Mutable Data

fn put_adata(&self, data: AData) -> Box<CoreFuture<()>>[src]

Put AppendOnly Data into the Network

fn get_adata(&self, address: ADataAddress) -> Box<CoreFuture<AData>>[src]

Get AppendOnly Data from the Network

fn get_adata_shell(
    &self,
    data_index: ADataIndex,
    address: ADataAddress
) -> Box<CoreFuture<AData>>
[src]

Get AppendOnly Data Shell from the Network

fn get_adata_value(
    &self,
    address: ADataAddress,
    key: Vec<u8>
) -> Box<CoreFuture<Vec<u8>>>
[src]

Fetch Value for the provided key from AppendOnly Data at {:?}

fn get_adata_range(
    &self,
    address: ADataAddress,
    range: (ADataIndex, ADataIndex)
) -> Box<CoreFuture<ADataEntries>>
[src]

Get a Set of Entries for the requested range from an AData.

fn get_adata_indices(
    &self,
    address: ADataAddress
) -> Box<CoreFuture<ADataIndices>>
[src]

Get latest indices from an AppendOnly Data.

fn get_adata_last_entry(
    &self,
    address: ADataAddress
) -> Box<CoreFuture<ADataEntry>>
[src]

Get the last data entry from an AppendOnly Data.

fn get_unpub_adata_permissions_at_index(
    &self,
    address: ADataAddress,
    permissions_index: ADataIndex
) -> Box<CoreFuture<ADataUnpubPermissions>>
[src]

Get permissions at the provided index.

fn get_pub_adata_permissions_at_index(
    &self,
    address: ADataAddress,
    permissions_index: ADataIndex
) -> Box<CoreFuture<ADataPubPermissions>>
[src]

Get permissions at the provided index.

fn get_pub_adata_user_permissions(
    &self,
    address: ADataAddress,
    permissions_index: ADataIndex,
    user: ADataUser
) -> Box<CoreFuture<ADataPubPermissionSet>>
[src]

Get permissions for a specified user(s).

fn get_unpub_adata_user_permissions(
    &self,
    address: ADataAddress,
    permissions_index: ADataIndex,
    public_key: PublicKey
) -> Box<CoreFuture<ADataUnpubPermissionSet>>
[src]

Get permissions for a specified user(s).

fn add_unpub_adata_permissions(
    &self,
    address: ADataAddress,
    permissions: ADataUnpubPermissions,
    permissions_index: u64
) -> Box<CoreFuture<()>>
[src]

Add AData Permissions

fn add_pub_adata_permissions(
    &self,
    address: ADataAddress,
    permissions: ADataPubPermissions,
    permissions_index: u64
) -> Box<CoreFuture<()>>
[src]

Add Pub AData Permissions

fn set_adata_owners(
    &self,
    address: ADataAddress,
    owner: ADataOwner,
    owners_index: u64
) -> Box<CoreFuture<()>>
[src]

Set new Owners to AData

fn get_adata_owners(
    &self,
    address: ADataAddress,
    owners_index: ADataIndex
) -> Box<CoreFuture<ADataOwner>>
[src]

Set new Owners to AData

fn append_seq_adata(
    &self,
    append: ADataAppendOperation,
    index: u64
) -> Box<CoreFuture<()>>
[src]

Append to Published Seq AppendOnly Data

fn append_unseq_adata(
    &self,
    append: ADataAppendOperation
) -> Box<CoreFuture<()>>
[src]

Append to Unpublished Unseq AppendOnly Data

fn list_mdata_permissions(
    &self,
    address: MDataAddress
) -> Box<CoreFuture<BTreeMap<PublicKey, MDataPermissionSet>>>
[src]

Return a list of permissions in MutableData stored on the network.

fn set_mdata_user_permissions(
    &self,
    address: MDataAddress,
    user: PublicKey,
    permissions: MDataPermissionSet,
    version: u64
) -> Box<CoreFuture<()>>
[src]

Updates or inserts a permissions set for a user

fn del_mdata_user_permissions(
    &self,
    address: MDataAddress,
    user: PublicKey,
    version: u64
) -> Box<CoreFuture<()>>
[src]

Updates or inserts a permissions set for a user

fn change_mdata_owner(
    &self,
    name: XorName,
    tag: u64,
    new_owner: PublicKey,
    version: u64
) -> Box<CoreFuture<()>>
[src]

Sends an ownership transfer request.

impl AuthActions for CoreClient[src]

fn list_auth_keys_and_version(
    &self
) -> Box<CoreFuture<(BTreeMap<PublicKey, AppPermissions>, u64)>>
[src]

Fetches a list of authorised keys and version.

fn ins_auth_key(
    &self,
    key: PublicKey,
    permissions: AppPermissions,
    version: u64
) -> Box<CoreFuture<()>>
[src]

Adds a new authorised key.

fn del_auth_key(&self, key: PublicKey, version: u64) -> Box<CoreFuture<()>>[src]

Removes an authorised key.

fn delete_mdata(&self, address: MDataAddress) -> Box<CoreFuture<()>>[src]

Delete MData from network

fn delete_adata(&self, address: ADataAddress) -> Box<CoreFuture<()>>[src]

Delete AData from network.

impl Clone for CoreClient[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T