pub struct SafeAccount {
    pub id: [u8; 16],
    pub version: Version,
    pub address: Address,
    pub crypto: Crypto,
    pub filename: Option<String>,
    pub name: String,
    pub meta: String,
}
Expand description

Account representation.

Fields

id: [u8; 16]

Account ID

version: Version

Account version

address: Address

Account address

crypto: Crypto

Account private key derivation definition.

filename: Option<String>

Account filename

name: String

Account name

meta: String

Account metadata

Implementations

Create a new account

Create a new SafeAccount from the given json; if it was read from a file, the filename should be Some name. If it is as yet anonymous, then it can be left None. In case password is provided, we will attempt to read the secret from the keyfile and derive the address from it instead of reading it directly. Providing password is required for json::KeyFiles with no address.

Create a new SafeAccount from the given vault json; if it was read from a file, the filename should be Some name. If it is as yet anonymous, then it can be left None.

Create a new VaultKeyFile from the given self

Sign a message.

Decrypt a message.

Agree on shared key.

Derive public key.

Change account’s password.

Check if password matches the account.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.