pub struct TempDbBackend { /* private fields */ }Expand description
A backend that is implemented via redb database stored in a temporary file.
The database file is dropped once the last instance is dropped.
Implementations§
Trait Implementations§
Source§impl Backend for TempDbBackend
impl Backend for TempDbBackend
type Error = Error
Source§fn insert_account(
&self,
account: AccountEntry,
) -> Result<Option<AccountEntry>, Self::Error>
fn insert_account( &self, account: AccountEntry, ) -> Result<Option<AccountEntry>, Self::Error>
Inserts an
AccountEntry into the backend. Read moreSource§fn insert_channel(
&self,
channel: ChannelEntry,
) -> Result<Option<ChannelEntry>, Self::Error>
fn insert_channel( &self, channel: ChannelEntry, ) -> Result<Option<ChannelEntry>, Self::Error>
Inserts a
ChannelEntry into the backend. Read moreSource§fn get_account_by_id(
&self,
id: &HoprKeyIdent,
) -> Result<Option<AccountEntry>, Self::Error>
fn get_account_by_id( &self, id: &HoprKeyIdent, ) -> Result<Option<AccountEntry>, Self::Error>
Retrieves an
AccountEntry by HoprKeyIdent.Source§fn get_account_by_key(
&self,
key: &OffchainPublicKey,
) -> Result<Option<AccountEntry>, Self::Error>
fn get_account_by_key( &self, key: &OffchainPublicKey, ) -> Result<Option<AccountEntry>, Self::Error>
Retrieves an
AccountEntry by OffchainPublicKey.Source§fn get_account_by_address(
&self,
chain_key: &Address,
) -> Result<Option<AccountEntry>, Self::Error>
fn get_account_by_address( &self, chain_key: &Address, ) -> Result<Option<AccountEntry>, Self::Error>
Retrieves an
AccountEntry by an on-chain Address.Source§fn get_channel_by_id(
&self,
id: &ChannelId,
) -> Result<Option<ChannelEntry>, Self::Error>
fn get_channel_by_id( &self, id: &ChannelId, ) -> Result<Option<ChannelEntry>, Self::Error>
Retrieves a
ChannelEntry by its ChannelId.Source§impl Clone for TempDbBackend
impl Clone for TempDbBackend
Source§fn clone(&self) -> TempDbBackend
fn clone(&self) -> TempDbBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TempDbBackend
impl !RefUnwindSafe for TempDbBackend
impl Send for TempDbBackend
impl Sync for TempDbBackend
impl Unpin for TempDbBackend
impl !UnwindSafe for TempDbBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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