Skip to main content

ClientStorage

Trait ClientStorage 

Source
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§

Source

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>

Get funding data for a channel

Source

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)

Save/update payment state for a channel

Source

fn get_state(&self, channel_id: &str) -> ClientChannelState

Get the lifecycle state of a channel

Source

fn set_closed(&mut self, channel_id: &str)

Mark a channel as closed

Source

fn list_channel_ids(&self) -> Vec<String>

List all stored channel IDs

Source

fn delete(&mut self, channel_id: &str)

Delete a channel and all its data

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§