[][src]Struct etebase::Account

pub struct Account {
    pub user: LoginResponseUser,
    // some fields omitted
}

Represents a user account and is the main object for all user interactions and data manipulation

Fields

user: LoginResponseUser

Implementations

impl Account[src]

pub fn is_etebase_server(client: &Client) -> Result<bool>[src]

Check whether the Client is pointing to a valid Etebase server

Arguments:

  • client - the already setup Client object

pub fn signup(client: Client, user: &User, password: &str) -> Result<Self>[src]

Signup a new user account and return a handle to it

Arguments:

  • client - the already setup Client object
  • user - the already setup User object
  • password - the password to signup with

pub fn signup_key(client: Client, user: &User, main_key: &[u8]) -> Result<Self>[src]

Signup a new user account with a key and return a handle to it

Unlike Self::signup, this uses a strong key instead of a password

Arguments:

  • client - the already setup Client object
  • user - the already setup User object
  • main_key - the key to signup with

pub fn login(client: Client, username: &str, password: &str) -> Result<Self>[src]

Login a user and return a handle to an Account object

Arguments:

  • username - the user's username. This is not the same as the user's email.
  • client - the already setup Client object
  • password - the user's password

pub fn login_key(
    client: Client,
    username: &str,
    main_key: &[u8]
) -> Result<Self>
[src]

Login a user with a key and return a handle to an Account object

Unlike Self::login, this uses a strong key instead of a password

Arguments:

  • username - the user's username. This is not the same as the user's email.
  • client - the already setup Client object
  • main_key - the key to signup with

pub fn fetch_token(&mut self) -> Result<()>[src]

Fetch a new auth token for the account and update the Account object with it

pub fn force_server_url(&mut self, api_base: &str) -> Result<()>[src]

Change the server URL for this account handle

Arguments:

  • api_base - the new server URL to be set

pub fn change_password(&mut self, password: &str) -> Result<()>[src]

Change the user's login password

Arguments:

  • password - the new password to be set

pub fn fetch_dashboard_url(&self) -> Result<String>[src]

Fetch the link to the user dashboard of the account

pub fn logout(&self) -> Result<()>[src]

Logout the user from the current session and invalidate the authentication token

pub fn save(&self, encryption_key: Option<&[u8]>) -> Result<String>[src]

Save the account object to a string for restoring it later using Self::restore

Arguments:

  • encryption_key - used to encrypt the returned account string to enhance security

pub fn restore(
    mut client: Client,
    account_data_stored: &str,
    encryption_key: Option<&[u8]>
) -> Result<Self>
[src]

Restore and return the Account object from the string obtained using Self::save

Arguments:

  • client - the already setup Client object
  • account_data_stored - the stored account string
  • encryption_key - the same encryption key passed to Self::save while saving the account

pub fn collection_manager(&self) -> Result<CollectionManager>[src]

Return a CollectionManager for creating, fetching and uploading collections

pub fn invitation_manager(&self) -> Result<CollectionInvitationManager>[src]

Return a CollectionInvitationManager for managing collection invitations

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.