FilesystemStore

Struct FilesystemStore 

Source
pub struct FilesystemStore { /* private fields */ }
Expand description

A KVStore and KVStoreSync implementation that writes to and reads from the file system.

Implementations§

Source§

impl FilesystemStore

Source

pub fn new(data_dir: PathBuf) -> Self

Constructs a new FilesystemStore.

Source

pub fn get_data_dir(&self) -> PathBuf

Returns the data directory.

Trait Implementations§

Source§

impl KVStore for FilesystemStore

Available on crate feature tokio only.
Source§

fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'static>>

Returns the data stored for the given primary_namespace, secondary_namespace, and key. Read more
Source§

fn write( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'static>>

Persists the given data under the given key. Read more
Source§

fn remove( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'static>>

Removes any data that had previously been persisted under the given key. Read more
Source§

fn list( &self, primary_namespace: &str, secondary_namespace: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'static>>

Returns a list of keys that are stored under the given secondary_namespace in primary_namespace. Read more
Source§

impl KVStoreSync for FilesystemStore

Source§

fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, ) -> Result<Vec<u8>, Error>

Returns the data stored for the given primary_namespace, secondary_namespace, and key. Read more
Source§

fn write( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: Vec<u8>, ) -> Result<(), Error>

Persists the given data under the given key. Read more
Source§

fn remove( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, lazy: bool, ) -> Result<(), Error>

Removes any data that had previously been persisted under the given key. Read more
Source§

fn list( &self, primary_namespace: &str, secondary_namespace: &str, ) -> Result<Vec<String>, Error>

Returns a list of keys that are stored under the given secondary_namespace in primary_namespace. Read more
Source§

impl MigratableKVStore for FilesystemStore

Source§

fn list_all_keys(&self) -> Result<Vec<(String, String, String)>, Error>

Returns all known keys as a list of primary_namespace, secondary_namespace, key tuples. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<ChannelSigner, K> Persist<ChannelSigner> for K
where ChannelSigner: EcdsaChannelSigner, K: KVStoreSync + ?Sized,

Source§

fn persist_new_channel( &self, monitor_name: MonitorName, monitor: &ChannelMonitor<ChannelSigner>, ) -> ChannelMonitorUpdateStatus

Persist a new channel’s data in response to a chain::Watch::watch_channel call. This is called by ChannelManager for new channels, or may be called directly, e.g. on startup, with the monitor_name returned by ChannelMonitor::persistence_key. Read more
Source§

fn update_persisted_channel( &self, monitor_name: MonitorName, _update: Option<&ChannelMonitorUpdate>, monitor: &ChannelMonitor<ChannelSigner>, ) -> ChannelMonitorUpdateStatus

Update one channel’s data. The provided ChannelMonitor has already applied the given update. Read more
Source§

fn archive_persisted_channel(&self, monitor_name: MonitorName)

Prevents the channel monitor from being loaded on startup. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.