pub struct RocksDbStorage<S> { /* private fields */ }Expand description
A persistent dialogue storage based on RocksDb.
Implementations§
Source§impl<S> RocksDbStorage<S>
impl<S> RocksDbStorage<S>
Sourcepub async fn open(
path: &str,
serializer: S,
options: Option<Options>,
) -> Result<Arc<Self>, RocksDbStorageError<Infallible>>
pub async fn open( path: &str, serializer: S, options: Option<Options>, ) -> Result<Arc<Self>, RocksDbStorageError<Infallible>>
Creates a new RocksDbStorage with the given path, serializer,
and options.
Trait Implementations§
Source§impl<S, D> Storage<D> for RocksDbStorage<S>where
S: Send + Sync + Serializer<D> + 'static,
D: Send + Serialize + DeserializeOwned + 'static,
<S as Serializer<D>>::Error: Debug + Display,
impl<S, D> Storage<D> for RocksDbStorage<S>where
S: Send + Sync + Serializer<D> + 'static,
D: Send + Serialize + DeserializeOwned + 'static,
<S as Serializer<D>>::Error: Debug + Display,
Source§fn remove_dialogue(
self: Arc<Self>,
ChatId: ChatId,
) -> BoxFuture<'static, Result<(), Self::Error>>
fn remove_dialogue( self: Arc<Self>, ChatId: ChatId, ) -> BoxFuture<'static, Result<(), Self::Error>>
Returns RocksDbStorageError::DialogueNotFound if a dialogue does not
exist.
type Error = RocksDbStorageError<<S as Serializer<D>>::Error>
Source§fn update_dialogue(
self: Arc<Self>,
ChatId: ChatId,
dialogue: D,
) -> BoxFuture<'static, Result<(), Self::Error>>
fn update_dialogue( self: Arc<Self>, ChatId: ChatId, dialogue: D, ) -> BoxFuture<'static, Result<(), Self::Error>>
Updates a dialogue indexed by
chat_id with dialogue.Auto Trait Implementations§
impl<S> !Freeze for RocksDbStorage<S>
impl<S> RefUnwindSafe for RocksDbStorage<S>where
S: RefUnwindSafe,
impl<S> Send for RocksDbStorage<S>where
S: Send,
impl<S> Sync for RocksDbStorage<S>where
S: Sync,
impl<S> Unpin for RocksDbStorage<S>where
S: Unpin,
impl<S> UnwindSafe for RocksDbStorage<S>where
S: 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
Source§impl<T> Erasable for T
impl<T> Erasable for T
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 more