Struct upm::database::Database [] [src]

pub struct Database {
    pub sync_revision: u32,
    pub sync_url: String,
    pub sync_credentials: String,
    pub accounts: Vec<Account>,
    // some fields omitted
}

This struct represents a UPM database, as read from a local file or a remote sync repository.

Fields

Methods

impl Database
[src]

Construct a fresh, empty database.

Load and decrypt a database from an in-memory byte slice using the provided password.

Load and decrypt a database from the given filename using the provided password.

Save the database locally using the same filename previously used to load the database.

Save the database locally using the provided filename and password.

Save an already-encoded database locally using the provided filename.

Save the database to an in-memory byte buffer. This is useful, for example, when sending the database to a remote sync repository.

Return a reference to the named account.

Return a mutable reference to the named account.

Return true if the database contains an account with the specified name; otherwise return false.

Update the named account with the fields in the provided account object. The account object may contain a new account name for this account.

Add a copy of the provided account object to the database as a new account.

Delete the specified account from the database.

Return true if this database has a remote sync repository configured; otherwise return false.

Set the path of the local database to the specified path.

Return the path to the local database, if known.

Return the name of the database, if available. The name is the final path component of the database in the local filesystem.

Return the name of a database that is represented by the provided filesystem path.

Set the password used to encrypt this database.

Retrieve the password used to encrypt and decrypt this database.

Mark the database as being synchronized with the remote sync repository. This is only valid for 5 minutes.

Mark the database as not being synchronized with the remote sync repository.

Return true if the database is synchronized with the remote sync repository; otherwise return false.

Trait Implementations

impl Clone for Database
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Database
[src]

Formats the value using the given formatter.

impl Display for Database
[src]

Print basic information about this database.