pub struct Backend { /* private fields */ }
Expand description
Backend for a server.
Implementations§
Source§impl Backend
impl Backend
Sourcepub fn new(paths: Arc<Paths>, target: BackendTarget) -> Self
pub fn new(paths: Arc<Paths>, target: BackendTarget) -> Self
Create a new server backend.
Sourcepub fn accounts(
&self,
) -> Arc<RwLock<HashMap<AccountId, Arc<RwLock<ServerStorage>>>>>
pub fn accounts( &self, ) -> Arc<RwLock<HashMap<AccountId, Arc<RwLock<ServerStorage>>>>>
Get the accounts.
Sourcepub async fn create_account(
&mut self,
account_id: &AccountId,
account_data: CreateSet,
) -> Result<()>
pub async fn create_account( &mut self, account_id: &AccountId, account_data: CreateSet, ) -> Result<()>
Create an account.
Sourcepub async fn delete_account(&mut self, account_id: &AccountId) -> Result<()>
pub async fn delete_account(&mut self, account_id: &AccountId) -> Result<()>
Delete an account.
Sourcepub async fn update_account(
&mut self,
account_id: &AccountId,
account_data: UpdateSet,
) -> Result<MergeOutcome>
pub async fn update_account( &mut self, account_id: &AccountId, account_data: UpdateSet, ) -> Result<MergeOutcome>
Update an account.
Sourcepub async fn fetch_account(&self, account_id: &AccountId) -> Result<CreateSet>
pub async fn fetch_account(&self, account_id: &AccountId) -> Result<CreateSet>
Fetch an existing account.
Sourcepub async fn account_exists(&self, account_id: &AccountId) -> Result<bool>
pub async fn account_exists(&self, account_id: &AccountId) -> Result<bool>
Determine if an account exists.
Auto Trait Implementations§
impl Freeze for Backend
impl !RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl !UnwindSafe for Backend
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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