pub trait ClientStorage {
// Required methods
fn save_funding(&mut self, channel_id: &str, funding: ClientChannelFunding);
fn get_funding(&self, channel_id: &str) -> Option<&ClientChannelFunding>;
fn get_payment_state(&self, channel_id: &str) -> Option<&ClientPaymentState>;
fn save_payment_state(
&mut self,
channel_id: &str,
state: ClientPaymentState,
);
fn get_state(&self, channel_id: &str) -> ClientChannelState;
fn set_closed(&mut self, channel_id: &str);
fn list_channel_ids(&self) -> Vec<String>;
fn delete(&mut self, channel_id: &str);
}Expand description
Storage trait for client channel data
Implementations handle persistence of channel funding data and payment state. The trait separates immutable funding data from mutable payment state.
Required Methods§
Sourcefn 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
Sourcefn get_funding(&self, channel_id: &str) -> Option<&ClientChannelFunding>
fn get_funding(&self, channel_id: &str) -> Option<&ClientChannelFunding>
Get funding data for a channel
Sourcefn 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
Sourcefn 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
Sourcefn get_state(&self, channel_id: &str) -> ClientChannelState
fn get_state(&self, channel_id: &str) -> ClientChannelState
Get the lifecycle state of a channel
Sourcefn set_closed(&mut self, channel_id: &str)
fn set_closed(&mut self, channel_id: &str)
Mark a channel as closed
Sourcefn list_channel_ids(&self) -> Vec<String>
fn list_channel_ids(&self) -> Vec<String>
List all stored channel IDs
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".