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

A KVStore implementation that writes to and reads from an SQLite database.

Implementations§

source§

impl SqliteStore

source

pub fn new( data_dir: PathBuf, db_file_name: Option<String>, kv_table_name: Option<String> ) -> Result<Self>

Constructs a new SqliteStore.

If not already existing, a new SQLite database will be created in the given data_dir under the given db_file_name (or the default to DEFAULT_SQLITE_DB_FILE_NAME if set to None).

Similarly, the given kv_table_name will be used or default to DEFAULT_KV_TABLE_NAME.

source

pub fn get_data_dir(&self) -> PathBuf

Returns the data directory.

Trait Implementations§

source§

impl KVStore for SqliteStore

source§

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

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: &[u8] ) -> Result<()>

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<()>

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

Returns a list of keys that are stored under the given secondary_namespace in primary_namespace. 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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: WriteableEcdsaChannelSigner, K: KVStore,

source§

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 more
source§

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 more
source§

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

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more