pub struct InMemory { /* private fields */ }
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
§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 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_iter(&self) -> Result<Self::Iter<'_>, InMemoryStorageError>
fn try_iter(&self) -> Result<Self::Iter<'_>, InMemoryStorageError>
Returns an iterator over all invoices in storage. Read more
source§impl OutputKeyStorage for InMemory
impl OutputKeyStorage for InMemory
Auto Trait Implementations§
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