pub struct SqliteStorage {
pub conn: Mutex<Connection>,
}Expand description
SQLite-backed storage for chat data.
Fields§
§conn: Mutex<Connection>Implementations§
Source§impl SqliteStorage
impl SqliteStorage
pub fn new(conn: Connection) -> Self
pub fn init_schema(&self) -> ChatResult<()>
pub fn get_setting(&self, key: &str) -> ChatResult<Option<Vec<u8>>>
pub fn set_setting(&self, key: &str, value: &[u8]) -> ChatResult<()>
pub fn get_stable_sender_id(&self) -> ChatResult<String>
pub fn set_stable_sender_id(&self, id: &str) -> ChatResult<()>
pub fn get_seq(&self, room_name: &str) -> ChatResult<i64>
pub fn set_seq(&self, room_name: &str, seq: i64) -> ChatResult<()>
pub fn clear_room(&self, room_name: &str) -> ChatResult<()>
pub fn clear_all(&self) -> ChatResult<()>
pub fn insert_yjs_update( &self, room_name: &str, blob: &[u8], timestamp: i64, ) -> ChatResult<()>
pub fn get_yjs_updates(&self, room_name: &str) -> ChatResult<Vec<Vec<u8>>>
Sourcepub fn save_bootstrap_peer(
&self,
room_name: &str,
peer_ticket: &str,
) -> ChatResult<()>
pub fn save_bootstrap_peer( &self, room_name: &str, peer_ticket: &str, ) -> ChatResult<()>
Save a bootstrap peer ticket for a room.
Sourcepub fn load_bootstrap_peers(&self, room_name: &str) -> ChatResult<Vec<String>>
pub fn load_bootstrap_peers(&self, room_name: &str) -> ChatResult<Vec<String>>
Load all bootstrap peer tickets for a room.
Sourcepub fn remove_bootstrap_peer(
&self,
room_name: &str,
peer_ticket: &str,
) -> ChatResult<()>
pub fn remove_bootstrap_peer( &self, room_name: &str, peer_ticket: &str, ) -> ChatResult<()>
Remove a specific bootstrap peer from a room.
Sourcepub fn clear_bootstrap_peers(&self, room_name: &str) -> ChatResult<()>
pub fn clear_bootstrap_peers(&self, room_name: &str) -> ChatResult<()>
Clear all bootstrap peers for a room.
Auto Trait Implementations§
impl !Freeze for SqliteStorage
impl RefUnwindSafe for SqliteStorage
impl Send for SqliteStorage
impl Sync for SqliteStorage
impl Unpin for SqliteStorage
impl UnwindSafe for SqliteStorage
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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