pub struct InMemoryStore { /* private fields */ }Expand description
In-memory store for tests and early client development.
Implementations§
Source§impl InMemoryStore
impl InMemoryStore
Sourcepub fn upsert_dialog(&self, dialog: DialogRecord)
pub fn upsert_dialog(&self, dialog: DialogRecord)
Inserts or replaces a dialog.
Sourcepub fn upsert_user(&self, user: UserRecord)
pub fn upsert_user(&self, user: UserRecord)
Inserts or replaces a user summary.
Sourcepub fn insert_message(&self, message: MessageRecord)
pub fn insert_message(&self, message: MessageRecord)
Inserts a message into history.
Trait Implementations§
Source§impl ClientStore for InMemoryStore
impl ClientStore for InMemoryStore
Source§fn save_session(
&self,
session: StoredSession,
) -> BoxFuture<'static, StoreResult<()>>
fn save_session( &self, session: StoredSession, ) -> BoxFuture<'static, StoreResult<()>>
Saves the current session.
Source§fn load_session(&self) -> BoxFuture<'static, StoreResult<Option<StoredSession>>>
fn load_session(&self) -> BoxFuture<'static, StoreResult<Option<StoredSession>>>
Loads the current session.
Source§fn clear_session(&self) -> BoxFuture<'static, StoreResult<()>>
fn clear_session(&self) -> BoxFuture<'static, StoreResult<()>>
Clears the current session.
Source§fn dialogs(
&self,
request: DialogsRequest,
) -> BoxFuture<'static, StoreResult<DialogsPage>>
fn dialogs( &self, request: DialogsRequest, ) -> BoxFuture<'static, StoreResult<DialogsPage>>
Lists stored dialogs.
Source§fn record_dialog(
&self,
dialog: DialogRecord,
) -> BoxFuture<'static, StoreResult<()>>
fn record_dialog( &self, dialog: DialogRecord, ) -> BoxFuture<'static, StoreResult<()>>
Records a dialog in local state.
Source§fn record_users(
&self,
users: Vec<UserRecord>,
) -> BoxFuture<'static, StoreResult<()>>
fn record_users( &self, users: Vec<UserRecord>, ) -> BoxFuture<'static, StoreResult<()>>
Records user summaries in local state.
Source§fn history(
&self,
request: HistoryRequest,
) -> BoxFuture<'static, StoreResult<HistoryPage>>
fn history( &self, request: HistoryRequest, ) -> BoxFuture<'static, StoreResult<HistoryPage>>
Fetches stored history.
Source§fn record_message(
&self,
message: MessageRecord,
) -> BoxFuture<'static, StoreResult<()>>
fn record_message( &self, message: MessageRecord, ) -> BoxFuture<'static, StoreResult<()>>
Records a message in stored history.
Source§fn record_transaction(
&self,
transaction: StoredTransaction,
) -> BoxFuture<'static, StoreResult<()>>
fn record_transaction( &self, transaction: StoredTransaction, ) -> BoxFuture<'static, StoreResult<()>>
Records a transaction state change.
Source§fn transaction(
&self,
transaction_id: TransactionId,
) -> BoxFuture<'static, StoreResult<Option<StoredTransaction>>>
fn transaction( &self, transaction_id: TransactionId, ) -> BoxFuture<'static, StoreResult<Option<StoredTransaction>>>
Finds a transaction by transaction ID.
Source§impl Clone for InMemoryStore
impl Clone for InMemoryStore
Source§fn clone(&self) -> InMemoryStore
fn clone(&self) -> InMemoryStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryStore
impl Debug for InMemoryStore
Source§impl Default for InMemoryStore
impl Default for InMemoryStore
Source§fn default() -> InMemoryStore
fn default() -> InMemoryStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InMemoryStore
impl RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnsafeUnpin for InMemoryStore
impl UnwindSafe for InMemoryStore
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