SqliteSsbDb

Struct SqliteSsbDb 

Source
pub struct SqliteSsbDb { /* private fields */ }

Implementations§

Source§

impl SqliteSsbDb

Source

pub fn new<S: AsRef<str>>(database_path: S, offset_log_path: S) -> SqliteSsbDb

Source

pub fn update_indexes_from_offset_file(&self) -> Result<()>

Trait Implementations§

Source§

impl SsbDb for SqliteSsbDb

Source§

fn append_batch<T: AsRef<[u8]>>( &self, _: &Multikey, messages: &[T], ) -> Result<()>

Append a batch of valid ssb messages authored by the feed_id.
Source§

fn get_entry_by_key<'a>(&'a self, message_key: &Multihash) -> Result<Vec<u8>>

Get an entry by its ssb message key.
Source§

fn get_entry_by_seq( &self, feed_id: &Multikey, sequence: i32, ) -> Result<Option<Vec<u8>>>

Get an entry by its sequence key + author.
Source§

fn get_feed_latest_sequence(&self, feed_id: &Multikey) -> Result<Option<i32>>

Get the latest sequence number for the given feed.
Source§

fn get_entries_newer_than_sequence<'a>( &'a self, feed_id: &Multikey, sequence: i32, limit: Option<i64>, include_keys: bool, include_values: bool, ) -> Result<Vec<Vec<u8>>>

Get all the entries for the given feed_id, with a sequence larger than sequence. Read more
Source§

fn rebuild_indexes(&self) -> Result<()>

You can rebuild the indexes in sqlite db (but not the offset file) if they become corrupted.

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.

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<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>,

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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

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

Source§

fn vzip(self) -> V