logo
pub struct Client { /* private fields */ }
Expand description

Client object

Implementations

Send a Cmd to the network and await a response. Cmds are not retried if the timeout is hit.

Sign data using the client keypair

Send a signed DataCmd to the network. This is to be part of a public API, for the user to provide the serialised and already signed cmd.

Reads Bytes from the network, whose contents are contained within on or more chunks.

Read bytes from the network. The contents are spread across multiple chunks in the network. This function invokes the self-encryptor and returns the data that was initially stored.

Takes position and length arguments which specify the start position and the length of bytes to be read. Passing 0 to position reads the data from the beginning, and the length is just an upper limit.

Tries to chunk the bytes, returning an address and chunks, without storing anything to network.

Directly writes Bytes to the network in the form of immutable chunks, without any batching.

Directly writes Bytes to the network in the form of immutable chunks, without any batching. It also attempts to verify that all the data was uploaded to the network before returning.

Calculates a LargeFile’s/SmallFile’s address from self encrypted chunks, without storing them onto the network.

Send a Query to the network and await a response. Queries are automatically retried using exponential backoff if the timeout is hit.

Send a Query to the network and await a response. Queries are not retried if the timeout is hit.

Send a Query to the network and await a response. This is part of a public API, for the user to provide the serialised and already signed query.

Publish all register mutation operations in a WAL to the network Incrementing the WAL index as successful writes are sent out. Stops at the first error. Starts publishing from the index when called again with the same WAL.

Creates a Register which can then be written to.

Returns a write ahead log (WAL) of register operations, note that the changes are not uploaded to the network until the WAL is published with publish_register_ops

A tag must be supplied. A xorname must be supplied, this can be random or deterministic as per your apps needs.

Write to Register

Returns a write ahead log (WAL) of register operations, note that the changes are not uploaded to the network until the WAL is published with publish_register_ops

Get the entire Register from the Network

Get the latest entry (or entries if branching)

source

pub async fn get_register_entry(
    &self,
    address: Address,
    hash: EntryHash
) -> Result<Entry, Error>

Get an entry from a Register on the Network by its hash

Get the owner of a Register.

Get the set of Permissions in a Register for a specific user.

Get the Policy of a Register.

Spend a DBC’s key image.

Return the set of spent proof shares if the provided DBC’s key image is spent

Easily manage connections to/from The Safe Network with the client and its APIs. Use a random client for read-only or one-time operations. Supply an existing, SecretKey which holds a SafeCoin balance to be able to perform write operations.

Bootstrap this client to the network.

In case of an existing SecretKey the client will attempt to retrieve the history of the key’s balance in order to be ready for any token operations.

Return the client’s keypair.

Useful for retrieving the PublicKey or KeyPair in the event you need to sign something

Return the client’s PublicKey.

Return the client’s DBC owner, which will be a secret key.

This can then be used to sign output DBCs during a DBC reissue.

Check if the provided public key is a known section key based on our current knowledge of the network and sections chains.

SectionTree used to bootstrap the client on the network.

This is updated by the client as it receives Anti-Entropy/update messages from the network. Any user of this API is responsible for caching it so it can use it for any new Client instance not needing to obtain all this information from the network all over again.

Create a builder to instantiate a Client

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more