pub struct InMemory { /* private fields */ }
Available on crate feature
in-memory
only.Expand description
In-memory store. Note that invoices stored in memory will not be recoverable on power loss. Burning bug mitigation will also be reset after application restart.
Implementations§
Trait Implementations§
Source§impl HeightStorage for InMemory
impl HeightStorage for InMemory
Source§impl InvoiceStorage for InMemory
impl InvoiceStorage for InMemory
Source§type Error = InMemoryStorageError
type Error = InMemoryStorageError
Error type for the storage layer.
Source§fn insert(&mut self, invoice: Invoice) -> Result<(), Self::Error>
fn insert(&mut self, invoice: Invoice) -> Result<(), Self::Error>
Insert invoice into storage for tracking. Read more
Source§fn remove(
&mut self,
invoice_id: InvoiceId,
) -> Result<Option<Invoice>, Self::Error>
fn remove( &mut self, invoice_id: InvoiceId, ) -> Result<Option<Invoice>, Self::Error>
Remove invoice from storage, returning the invoice if it existed. Read more
Source§fn update(&mut self, invoice: Invoice) -> Result<Option<Invoice>, Self::Error>
fn update(&mut self, invoice: Invoice) -> Result<Option<Invoice>, Self::Error>
Update existing invoice in storage, returning old value if it existed.
If the invoice does not already exist, does nothing. Read more
Source§fn get(&self, invoice_id: InvoiceId) -> Result<Option<Invoice>, Self::Error>
fn get(&self, invoice_id: InvoiceId) -> Result<Option<Invoice>, Self::Error>
Retrieve invoice from storage, returning
None
if it does not exist. Read moreSource§fn get_ids(&self) -> Result<Vec<InvoiceId>, Self::Error>
fn get_ids(&self) -> Result<Vec<InvoiceId>, Self::Error>
Retrieve all currently-tracked invoice ids from storage. Read more
Source§fn contains_sub_index(&self, sub_index: SubIndex) -> Result<bool, Self::Error>
fn contains_sub_index(&self, sub_index: SubIndex) -> Result<bool, Self::Error>
Returns whether an invoice for the given subaddress exists in storage. Read more
Source§fn try_for_each<F>(&self, f: F) -> Result<(), Self::Error>
fn try_for_each<F>(&self, f: F) -> Result<(), Self::Error>
Iterates over all invoices in storage, executing the supplied closure on
each. Read more
Source§impl OutputKeyStorage for InMemory
impl OutputKeyStorage for InMemory
Auto Trait Implementations§
impl Freeze for InMemory
impl RefUnwindSafe for InMemory
impl Send for InMemory
impl Sync for InMemory
impl Unpin for InMemory
impl UnwindSafe for InMemory
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> 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