Struct lightning_persister::FilesystemPersister [−][src]
FilesystemPersister persists channel data on disk, where each channel’s data is stored in a file named after its funding outpoint.
Warning: this module does the best it can with calls to persist data, but it can only guarantee that the data is passed to the drive. It is up to the drive manufacturers to do the actual persistence properly, which they often don’t (especially on consumer-grade hardware). Therefore, it is up to the user to validate their entire storage stack, to ensure the writes are persistent. Corollary: especially when dealing with larger amounts of money, it is best practice to have multiple channel data backups and not rely only on one FilesystemPersister.
Implementations
impl FilesystemPersister
[src]
pub fn new(path_to_channel_data: String) -> Self
[src]
Initialize a new FilesystemPersister and set the path to the individual channels’ files.
pub fn get_data_dir(&self) -> String
[src]
pub fn persist_manager<Signer, M, T, K, F, L>(
data_dir: String,
manager: &ChannelManager<Signer, Arc<M>, Arc<T>, Arc<K>, Arc<F>, Arc<L>>
) -> Result<(), Error> where
Signer: Sign,
M: Watch<Signer>,
T: BroadcasterInterface,
K: KeysInterface<Signer = Signer>,
F: FeeEstimator,
L: Logger,
[src]
data_dir: String,
manager: &ChannelManager<Signer, Arc<M>, Arc<T>, Arc<K>, Arc<F>, Arc<L>>
) -> Result<(), Error> where
Signer: Sign,
M: Watch<Signer>,
T: BroadcasterInterface,
K: KeysInterface<Signer = Signer>,
F: FeeEstimator,
L: Logger,
Writes the provided ChannelManager
to the path provided at FilesystemPersister
initialization, within a file called “manager”.
Trait Implementations
impl<ChannelSigner: Sign + Send + Sync> Persist<ChannelSigner> for FilesystemPersister
[src]
fn persist_new_channel(
&self,
funding_txo: OutPoint,
monitor: &ChannelMonitor<ChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]
&self,
funding_txo: OutPoint,
monitor: &ChannelMonitor<ChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
fn update_persisted_channel(
&self,
funding_txo: OutPoint,
_update: &ChannelMonitorUpdate,
monitor: &ChannelMonitor<ChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]
&self,
funding_txo: OutPoint,
_update: &ChannelMonitorUpdate,
monitor: &ChannelMonitor<ChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
Auto Trait Implementations
impl RefUnwindSafe for FilesystemPersister
impl Send for FilesystemPersister
impl Sync for FilesystemPersister
impl Unpin for FilesystemPersister
impl UnwindSafe for FilesystemPersister
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,