Struct lightning_persister::fs_store::FilesystemStore
source · pub struct FilesystemStore { /* private fields */ }
Expand description
A KVStore
implementation that writes to and reads from the file system.
Implementations§
source§impl FilesystemStore
impl FilesystemStore
sourcepub fn new(data_dir: PathBuf) -> Self
pub fn new(data_dir: PathBuf) -> Self
Constructs a new FilesystemStore
.
sourcepub fn get_data_dir(&self) -> PathBuf
pub fn get_data_dir(&self) -> PathBuf
Returns the data directory.
Trait Implementations§
source§impl KVStore for FilesystemStore
impl KVStore for FilesystemStore
source§fn read(
&self,
primary_namespace: &str,
secondary_namespace: &str,
key: &str
) -> Result<Vec<u8>>
fn read( &self, primary_namespace: &str, secondary_namespace: &str, key: &str ) -> Result<Vec<u8>>
source§fn write(
&self,
primary_namespace: &str,
secondary_namespace: &str,
key: &str,
buf: &[u8]
) -> Result<()>
fn write( &self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8] ) -> Result<()>
Persists the given data under the given
key
. Read moreAuto Trait Implementations§
impl !Freeze for FilesystemStore
impl RefUnwindSafe for FilesystemStore
impl Send for FilesystemStore
impl Sync for FilesystemStore
impl Unpin for FilesystemStore
impl UnwindSafe for FilesystemStore
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
source§impl<ChannelSigner, K> Persist<ChannelSigner> for Kwhere
ChannelSigner: WriteableEcdsaChannelSigner,
K: KVStore,
impl<ChannelSigner, K> Persist<ChannelSigner> for Kwhere
ChannelSigner: WriteableEcdsaChannelSigner,
K: KVStore,
source§fn persist_new_channel(
&self,
funding_txo: OutPoint,
monitor: &ChannelMonitor<ChannelSigner>,
_update_id: MonitorUpdateId
) -> ChannelMonitorUpdateStatus
fn persist_new_channel( &self, funding_txo: OutPoint, monitor: &ChannelMonitor<ChannelSigner>, _update_id: MonitorUpdateId ) -> 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. Read moresource§fn update_persisted_channel(
&self,
funding_txo: OutPoint,
_update: Option<&ChannelMonitorUpdate>,
monitor: &ChannelMonitor<ChannelSigner>,
_update_id: MonitorUpdateId
) -> ChannelMonitorUpdateStatus
fn update_persisted_channel( &self, funding_txo: OutPoint, _update: Option<&ChannelMonitorUpdate>, monitor: &ChannelMonitor<ChannelSigner>, _update_id: MonitorUpdateId ) -> ChannelMonitorUpdateStatus
Update one channel’s data. The provided
ChannelMonitor
has already applied the given
update. Read moresource§impl<'a, A, M, T, ES, NS, SP, F, R, L, S> Persister<'a, M, T, ES, NS, SP, F, R, L, S> for Awhere
A: KVStore,
M: Deref,
T: Deref,
ES: Deref,
NS: Deref,
SP: Deref,
F: Deref,
R: Deref,
L: Deref,
S: WriteableScore<'a>,
<M as Deref>::Target: 'static + Watch<<<SP as Deref>::Target as SignerProvider>::EcdsaSigner>,
<T as Deref>::Target: 'static + BroadcasterInterface,
<ES as Deref>::Target: 'static + EntropySource,
<NS as Deref>::Target: 'static + NodeSigner,
<SP as Deref>::Target: 'static + SignerProvider,
<F as Deref>::Target: 'static + FeeEstimator,
<R as Deref>::Target: 'static + Router,
<L as Deref>::Target: 'static + Logger,
impl<'a, A, M, T, ES, NS, SP, F, R, L, S> Persister<'a, M, T, ES, NS, SP, F, R, L, S> for Awhere
A: KVStore,
M: Deref,
T: Deref,
ES: Deref,
NS: Deref,
SP: Deref,
F: Deref,
R: Deref,
L: Deref,
S: WriteableScore<'a>,
<M as Deref>::Target: 'static + Watch<<<SP as Deref>::Target as SignerProvider>::EcdsaSigner>,
<T as Deref>::Target: 'static + BroadcasterInterface,
<ES as Deref>::Target: 'static + EntropySource,
<NS as Deref>::Target: 'static + NodeSigner,
<SP as Deref>::Target: 'static + SignerProvider,
<F as Deref>::Target: 'static + FeeEstimator,
<R as Deref>::Target: 'static + Router,
<L as Deref>::Target: 'static + Logger,
source§fn persist_manager(
&self,
channel_manager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
) -> Result<(), Error>
fn persist_manager( &self, channel_manager: &ChannelManager<M, T, ES, NS, SP, F, R, L> ) -> Result<(), Error>
Persist the given ChannelManager
to disk, returning an error if persistence failed.
source§fn persist_graph(&self, network_graph: &NetworkGraph<L>) -> Result<(), Error>
fn persist_graph(&self, network_graph: &NetworkGraph<L>) -> Result<(), Error>
Persist the given NetworkGraph
to disk, returning an error if persistence failed.
source§fn persist_scorer(&self, scorer: &S) -> Result<(), Error>
fn persist_scorer(&self, scorer: &S) -> Result<(), Error>
Persist the given WriteableScore
to disk, returning an error if persistence failed.