pub struct Store<K, A> { /* private fields */ }
Expand description
Persists data in to a relational schema based SQLite database file.
The changesets loaded or stored represent changes to keychain and blockchain data.
Implementations§
Source§impl<K, A> Store<K, A>where
K: Ord + for<'de> Deserialize<'de> + Serialize + Send,
A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,
impl<K, A> Store<K, A>where
K: Ord + for<'de> Deserialize<'de> + Serialize + Send,
A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,
Sourcepub fn new(conn: Connection) -> Result<Self, Error>
pub fn new(conn: Connection) -> Result<Self, Error>
Creates a new store from a Connection
.
Source§impl<K, A> Store<K, A>where
K: Ord + for<'de> Deserialize<'de> + Serialize + Send,
A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,
Functions to read and write all CombinedChangeSet
data.
impl<K, A> Store<K, A>where
K: Ord + for<'de> Deserialize<'de> + Serialize + Send,
A: Anchor + for<'de> Deserialize<'de> + Serialize + Send,
Functions to read and write all CombinedChangeSet
data.
Sourcepub fn write(
&mut self,
changeset: &CombinedChangeSet<K, A>,
) -> Result<(), Error>
pub fn write( &mut self, changeset: &CombinedChangeSet<K, A>, ) -> Result<(), Error>
Write the given changeset
atomically.
Sourcepub fn read(&mut self) -> Result<Option<CombinedChangeSet<K, A>>, Error>
pub fn read(&mut self) -> Result<Option<CombinedChangeSet<K, A>>, Error>
Read the entire database and return the aggregate CombinedChangeSet
.
Trait Implementations§
Auto Trait Implementations§
impl<K, A> !Freeze for Store<K, A>
impl<K, A> RefUnwindSafe for Store<K, A>where
K: RefUnwindSafe,
A: RefUnwindSafe,
impl<K, A> Send for Store<K, A>
impl<K, A> Sync for Store<K, A>
impl<K, A> Unpin for Store<K, A>
impl<K, A> UnwindSafe for Store<K, A>where
K: UnwindSafe,
A: UnwindSafe,
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