pub struct AccountEntity<'conn, C>where
C: Deref<Target = Connection>,{ /* private fields */ }Expand description
Account entity.
Implementations§
Source§impl<'conn> AccountEntity<'conn, Box<Connection>>
impl<'conn> AccountEntity<'conn, Box<Connection>>
Sourcepub async fn list_all_accounts(
client: &Client,
) -> Result<Vec<AccountRecord>, Error>
pub async fn list_all_accounts( client: &Client, ) -> Result<Vec<AccountRecord>, Error>
Liat all accounts.
Sourcepub async fn find_account_with_login(
client: &Client,
account_id: &AccountId,
) -> Result<(AccountRecord, FolderRecord), Error>
pub async fn find_account_with_login( client: &Client, account_id: &AccountId, ) -> Result<(AccountRecord, FolderRecord), Error>
Find an account and login folder.
Sourcepub async fn find_account_with_login_optional(
client: &Client,
account_id: &AccountId,
) -> Result<(AccountRecord, Option<FolderRecord>), Error>
pub async fn find_account_with_login_optional( client: &Client, account_id: &AccountId, ) -> Result<(AccountRecord, Option<FolderRecord>), Error>
Find an account and optional login folder.
Source§impl<'conn> AccountEntity<'conn, Transaction<'conn>>
impl<'conn> AccountEntity<'conn, Transaction<'conn>>
Sourcepub async fn upsert_login_folder(
client: &Client,
account_id: &AccountId,
vault: &Vault,
) -> Result<(AccountRecord, i64), Error>
pub async fn upsert_login_folder( client: &Client, account_id: &AccountId, vault: &Vault, ) -> Result<(AccountRecord, i64), Error>
Upsert the login folder.
Source§impl<'conn, C> AccountEntity<'conn, C>where
C: Deref<Target = Connection>,
impl<'conn, C> AccountEntity<'conn, C>where
C: Deref<Target = Connection>,
Sourcepub fn find_one(&self, account_id: &AccountId) -> Result<AccountRow, SqlError>
pub fn find_one(&self, account_id: &AccountId) -> Result<AccountRow, SqlError>
Find an account in the database.
Sourcepub fn find_optional(
&self,
account_id: &AccountId,
) -> Result<Option<AccountRow>, SqlError>
pub fn find_optional( &self, account_id: &AccountId, ) -> Result<Option<AccountRow>, SqlError>
Find an optional account in the database.
Sourcepub fn list_accounts(&self) -> Result<Vec<AccountRow>, Error>
pub fn list_accounts(&self) -> Result<Vec<AccountRow>, Error>
List accounts.
Sourcepub fn insert(&self, row: &AccountRow) -> Result<i64, SqlError>
pub fn insert(&self, row: &AccountRow) -> Result<i64, SqlError>
Create the account entity in the database.
Sourcepub fn insert_login_folder(
&self,
account_id: i64,
folder_id: i64,
) -> Result<i64, SqlError>
pub fn insert_login_folder( &self, account_id: i64, folder_id: i64, ) -> Result<i64, SqlError>
Create the join for the account login folder.
Sourcepub fn update_login_folder(
&self,
account_id: i64,
folder_id: i64,
) -> Result<(), SqlError>
pub fn update_login_folder( &self, account_id: i64, folder_id: i64, ) -> Result<(), SqlError>
Update the join for an account login folder.
Sourcepub fn insert_device_folder(
&self,
account_id: i64,
folder_id: i64,
) -> Result<i64, SqlError>
pub fn insert_device_folder( &self, account_id: i64, folder_id: i64, ) -> Result<i64, SqlError>
Create the join for the account device folder.
Auto Trait Implementations§
impl<'conn, C> Freeze for AccountEntity<'conn, C>
impl<'conn, C> RefUnwindSafe for AccountEntity<'conn, C>where
C: RefUnwindSafe,
impl<'conn, C> Send for AccountEntity<'conn, C>where
C: Sync,
impl<'conn, C> Sync for AccountEntity<'conn, C>where
C: Sync,
impl<'conn, C> Unpin for AccountEntity<'conn, C>
impl<'conn, C> UnwindSafe for AccountEntity<'conn, C>where
C: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more