pub struct FilesystemPersister { /* private fields */ }
Expand description

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

Initialize a new FilesystemPersister and set the path to the individual channels’ files.

Get the directory which was provided when this persister was initialized.

Writes the provided ChannelManager to the path provided at FilesystemPersister initialization, within a file called “manager”.

Write the provided NetworkGraph to the path provided at FilesystemPersister initialization, within a file called “network_graph”

Read ChannelMonitors from disk.

Trait Implementations

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 more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.