pub struct SqliteStore<L, E> { /* private fields */ }Expand description
SQLite-based persistent store.
Implementations§
Source§impl<L, E> SqliteStore<L, E>where
L: LogId,
E: Extensions,
impl<L, E> SqliteStore<L, E>where
L: LogId,
E: Extensions,
Trait Implementations§
Source§impl<L: Clone, E: Clone> Clone for SqliteStore<L, E>
impl<L: Clone, E: Clone> Clone for SqliteStore<L, E>
Source§fn clone(&self) -> SqliteStore<L, E>
fn clone(&self) -> SqliteStore<L, E>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<L, E> LogStore<L, E> for SqliteStore<L, E>
impl<L, E> LogStore<L, E> for SqliteStore<L, E>
type Error = SqliteStoreError
Source§async fn get_log(
&self,
public_key: &PublicKey,
log_id: &L,
from: Option<u64>,
) -> Result<Option<Vec<(Header<E>, Option<Body>)>>, Self::Error>
async fn get_log( &self, public_key: &PublicKey, log_id: &L, from: Option<u64>, ) -> Result<Option<Vec<(Header<E>, Option<Body>)>>, Self::Error>
Get operations from an authors’ log ordered by sequence number. Read more
Source§async fn get_raw_log(
&self,
public_key: &PublicKey,
log_id: &L,
from: Option<u64>,
) -> Result<Option<Vec<RawOperation>>, Self::Error>
async fn get_raw_log( &self, public_key: &PublicKey, log_id: &L, from: Option<u64>, ) -> Result<Option<Vec<RawOperation>>, Self::Error>
Get “raw” header and body bytes from an authors’ log ordered by sequence number. Read more
Source§async fn latest_operation(
&self,
public_key: &PublicKey,
log_id: &L,
) -> Result<Option<(Header<E>, Option<Body>)>, Self::Error>
async fn latest_operation( &self, public_key: &PublicKey, log_id: &L, ) -> Result<Option<(Header<E>, Option<Body>)>, Self::Error>
Get only the latest operation from an authors’ log. Read more
Source§async fn delete_operations(
&mut self,
public_key: &PublicKey,
log_id: &L,
before: u64,
) -> Result<bool, Self::Error>
async fn delete_operations( &mut self, public_key: &PublicKey, log_id: &L, before: u64, ) -> Result<bool, Self::Error>
Delete all operations in a log before the given sequence number. Read more
Source§impl<L, E> OperationStore<L, E> for SqliteStore<L, E>
impl<L, E> OperationStore<L, E> for SqliteStore<L, E>
type Error = SqliteStoreError
Source§async fn insert_operation(
&mut self,
hash: Hash,
header: &Header<E>,
body: Option<&Body>,
header_bytes: &[u8],
log_id: &L,
) -> Result<bool, Self::Error>
async fn insert_operation( &mut self, hash: Hash, header: &Header<E>, body: Option<&Body>, header_bytes: &[u8], log_id: &L, ) -> Result<bool, Self::Error>
Insert an operation. Read more
Source§async fn get_operation(
&self,
hash: Hash,
) -> Result<Option<(Header<E>, Option<Body>)>, Self::Error>
async fn get_operation( &self, hash: Hash, ) -> Result<Option<(Header<E>, Option<Body>)>, Self::Error>
Get an operation.
Source§async fn get_raw_operation(
&self,
hash: Hash,
) -> Result<Option<RawOperation>, Self::Error>
async fn get_raw_operation( &self, hash: Hash, ) -> Result<Option<RawOperation>, Self::Error>
Get the “raw” header and body bytes of an operation.
Source§async fn has_operation(&self, hash: Hash) -> Result<bool, Self::Error>
async fn has_operation(&self, hash: Hash) -> Result<bool, Self::Error>
Query the existence of an operation. Read more
Auto Trait Implementations§
impl<L, E> Freeze for SqliteStore<L, E>
impl<L, E> !RefUnwindSafe for SqliteStore<L, E>
impl<L, E> Send for SqliteStore<L, E>
impl<L, E> Sync for SqliteStore<L, E>
impl<L, E> Unpin for SqliteStore<L, E>
impl<L, E> !UnwindSafe for SqliteStore<L, E>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<LogId, Extensions, TraitVariantBlanketType> LocalLogStore<LogId, Extensions> for TraitVariantBlanketTypewhere
TraitVariantBlanketType: LogStore<LogId, Extensions>,
impl<LogId, Extensions, TraitVariantBlanketType> LocalLogStore<LogId, Extensions> for TraitVariantBlanketTypewhere
TraitVariantBlanketType: LogStore<LogId, Extensions>,
type Error = <TraitVariantBlanketType as LogStore<LogId, Extensions>>::Error
Source§async fn get_log(
&self,
public_key: &PublicKey,
log_id: &LogId,
from: Option<u64>,
) -> Result<Option<Vec<(Header<Extensions>, Option<Body>)>>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
async fn get_log( &self, public_key: &PublicKey, log_id: &LogId, from: Option<u64>, ) -> Result<Option<Vec<(Header<Extensions>, Option<Body>)>>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
Get operations from an authors’ log ordered by sequence number. Read more
Source§async fn get_raw_log(
&self,
public_key: &PublicKey,
log_id: &LogId,
from: Option<u64>,
) -> Result<Option<Vec<(Vec<u8>, Option<Vec<u8>>)>>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
async fn get_raw_log( &self, public_key: &PublicKey, log_id: &LogId, from: Option<u64>, ) -> Result<Option<Vec<(Vec<u8>, Option<Vec<u8>>)>>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
Get “raw” header and body bytes from an authors’ log ordered by sequence number. Read more
Source§async fn get_log_heights(
&self,
log_id: &LogId,
) -> Result<Vec<(PublicKey, u64)>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
async fn get_log_heights( &self, log_id: &LogId, ) -> Result<Vec<(PublicKey, u64)>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
Get the log heights of all logs, by any author, which are stored under the passed log id.
Source§async fn latest_operation(
&self,
public_key: &PublicKey,
log_id: &LogId,
) -> Result<Option<(Header<Extensions>, Option<Body>)>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
async fn latest_operation( &self, public_key: &PublicKey, log_id: &LogId, ) -> Result<Option<(Header<Extensions>, Option<Body>)>, <TraitVariantBlanketType as LocalLogStore<LogId, Extensions>>::Error>
Get only the latest operation from an authors’ log. Read more
Source§impl<LogId, Extensions, TraitVariantBlanketType> LocalOperationStore<LogId, Extensions> for TraitVariantBlanketTypewhere
TraitVariantBlanketType: OperationStore<LogId, Extensions>,
impl<LogId, Extensions, TraitVariantBlanketType> LocalOperationStore<LogId, Extensions> for TraitVariantBlanketTypewhere
TraitVariantBlanketType: OperationStore<LogId, Extensions>,
type Error = <TraitVariantBlanketType as OperationStore<LogId, Extensions>>::Error
Source§async fn insert_operation(
&mut self,
hash: Hash,
header: &Header<Extensions>,
body: Option<&Body>,
header_bytes: &[u8],
log_id: &LogId,
) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
async fn insert_operation( &mut self, hash: Hash, header: &Header<Extensions>, body: Option<&Body>, header_bytes: &[u8], log_id: &LogId, ) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
Insert an operation. Read more
Source§async fn get_operation(
&self,
hash: Hash,
) -> Result<Option<(Header<Extensions>, Option<Body>)>, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
async fn get_operation( &self, hash: Hash, ) -> Result<Option<(Header<Extensions>, Option<Body>)>, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
Get an operation.
Source§async fn get_raw_operation(
&self,
hash: Hash,
) -> Result<Option<(Vec<u8>, Option<Vec<u8>>)>, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
async fn get_raw_operation( &self, hash: Hash, ) -> Result<Option<(Vec<u8>, Option<Vec<u8>>)>, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
Get the “raw” header and body bytes of an operation.
Source§async fn has_operation(
&self,
hash: Hash,
) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
async fn has_operation( &self, hash: Hash, ) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
Query the existence of an operation. Read more
Source§async fn delete_operation(
&mut self,
hash: Hash,
) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
async fn delete_operation( &mut self, hash: Hash, ) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
Delete an operation. Read more
Source§async fn delete_payload(
&mut self,
hash: Hash,
) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
async fn delete_payload( &mut self, hash: Hash, ) -> Result<bool, <TraitVariantBlanketType as LocalOperationStore<LogId, Extensions>>::Error>
Delete the payload of an operation. Read more