pub struct MemoryClientStorage { /* private fields */ }Expand description
In-memory storage implementation
Stores all channel data in HashMaps. Data is lost when the process exits. Suitable for testing, demos, and short-lived applications.
Implementations§
Source§impl MemoryClientStorage
impl MemoryClientStorage
Sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Get the number of stored channels
Trait Implementations§
Source§impl ClientStorage for MemoryClientStorage
impl ClientStorage for MemoryClientStorage
Source§fn save_funding(&mut self, channel_id: &str, funding: ClientChannelFunding)
fn save_funding(&mut self, channel_id: &str, funding: ClientChannelFunding)
Save funding data for a new channel
Source§fn get_funding(&self, channel_id: &str) -> Option<&ClientChannelFunding>
fn get_funding(&self, channel_id: &str) -> Option<&ClientChannelFunding>
Get funding data for a channel
Source§fn get_payment_state(&self, channel_id: &str) -> Option<&ClientPaymentState>
fn get_payment_state(&self, channel_id: &str) -> Option<&ClientPaymentState>
Get the current payment state for a channel
Source§fn save_payment_state(&mut self, channel_id: &str, state: ClientPaymentState)
fn save_payment_state(&mut self, channel_id: &str, state: ClientPaymentState)
Save/update payment state for a channel
Source§fn get_state(&self, channel_id: &str) -> ClientChannelState
fn get_state(&self, channel_id: &str) -> ClientChannelState
Get the lifecycle state of a channel
Source§fn set_closed(&mut self, channel_id: &str)
fn set_closed(&mut self, channel_id: &str)
Mark a channel as closed
Source§fn list_channel_ids(&self) -> Vec<String>
fn list_channel_ids(&self) -> Vec<String>
List all stored channel IDs
Source§impl Debug for MemoryClientStorage
impl Debug for MemoryClientStorage
Source§impl Default for MemoryClientStorage
impl Default for MemoryClientStorage
Source§fn default() -> MemoryClientStorage
fn default() -> MemoryClientStorage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryClientStorage
impl RefUnwindSafe for MemoryClientStorage
impl Send for MemoryClientStorage
impl Sync for MemoryClientStorage
impl Unpin for MemoryClientStorage
impl UnsafeUnpin for MemoryClientStorage
impl UnwindSafe for MemoryClientStorage
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