Struct sos_server::Backend
source · pub struct Backend { /* private fields */ }Expand description
Backend for a server.
Implementations§
source§impl Backend
impl Backend
sourcepub fn accounts(
&self,
) -> Arc<RwLock<HashMap<Address, Arc<RwLock<AccountStorage>>>>>
pub fn accounts( &self, ) -> Arc<RwLock<HashMap<Address, Arc<RwLock<AccountStorage>>>>>
Get the accounts.
sourcepub async fn create_account(
&mut self,
owner: &Address,
account_data: CreateSet,
) -> Result<()>
pub async fn create_account( &mut self, owner: &Address, account_data: CreateSet, ) -> Result<()>
Create an account.
sourcepub async fn delete_account(&mut self, owner: &Address) -> Result<()>
pub async fn delete_account(&mut self, owner: &Address) -> Result<()>
Delete an account.
sourcepub async fn update_account(
&mut self,
owner: &Address,
account_data: UpdateSet,
) -> Result<MergeOutcome>
pub async fn update_account( &mut self, owner: &Address, account_data: UpdateSet, ) -> Result<MergeOutcome>
Update an account.
sourcepub async fn fetch_account(&self, owner: &Address) -> Result<CreateSet>
pub async fn fetch_account(&self, owner: &Address) -> Result<CreateSet>
Fetch an existing account.
sourcepub async fn account_exists(&self, owner: &Address) -> Result<bool>
pub async fn account_exists(&self, owner: &Address) -> 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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more