pub struct SqliteMailboxStore { /* private fields */ }Expand description
A MailboxStore backed by a SQLite database.
Thread safety: a Mutex<Connection> serialises all writes, which is sufficient
for the atomic-claim guarantee (the UPDATE WHERE state='unread' rowcount test).
Implementations§
Source§impl SqliteMailboxStore
impl SqliteMailboxStore
Sourcepub fn open(path: &str) -> Result<Self, StoreError>
pub fn open(path: &str) -> Result<Self, StoreError>
Open (or create) a store at the given file path.
Sourcepub fn open_in_memory() -> Result<Self, StoreError>
pub fn open_in_memory() -> Result<Self, StoreError>
Open a transient in-memory store (useful in tests).
Trait Implementations§
Source§impl MailboxStore for SqliteMailboxStore
impl MailboxStore for SqliteMailboxStore
Source§type Error = StoreError
type Error = StoreError
The error type returned by store operations.
Source§fn inbox(&self, team_id: &str, to: &str) -> Result<Vec<Message>, StoreError>
fn inbox(&self, team_id: &str, to: &str) -> Result<Vec<Message>, StoreError>
Return all unread messages addressed to
to in team_id.Source§fn unclaim(&self, message_id: Uuid) -> Result<(), StoreError>
fn unclaim(&self, message_id: Uuid) -> Result<(), StoreError>
Roll back a claim: transition message state from
Delivered to Unread.Source§fn task_create(&self, task: &Task) -> Result<(), StoreError>
fn task_create(&self, task: &Task) -> Result<(), StoreError>
Insert a new task.
Source§fn task_update(
&self,
id: Uuid,
state: MailboxTaskState,
note: Option<&str>,
) -> Result<(), StoreError>
fn task_update( &self, id: Uuid, state: MailboxTaskState, note: Option<&str>, ) -> Result<(), StoreError>
Advance a task’s state, optionally recording a note.
Auto Trait Implementations§
impl !Freeze for SqliteMailboxStore
impl RefUnwindSafe for SqliteMailboxStore
impl Send for SqliteMailboxStore
impl Sync for SqliteMailboxStore
impl Unpin for SqliteMailboxStore
impl UnsafeUnpin for SqliteMailboxStore
impl UnwindSafe for SqliteMailboxStore
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