SledStateStore

Struct SledStateStore 

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

Implementations§

Source§

impl SledStateStore

Source

pub fn builder() -> SledStateStoreBuilder

Generate a SledStateStoreBuilder with default parameters

Source

pub fn open() -> StoreResult<Self>

👎Deprecated: Use SledStateStoreBuilder instead.
Source

pub fn open_with_passphrase( path: impl AsRef<Path>, passphrase: &str, ) -> StoreResult<Self>

👎Deprecated: Use SledStateStoreBuilder instead.
Source

pub fn open_with_path(path: impl AsRef<Path>) -> StoreResult<Self>

👎Deprecated: Use SledStateStoreBuilder instead.
Source

pub fn open_crypto_store(&self) -> Result<SledCryptoStore, OpenStoreError>

Open a SledCryptoStore that uses the same database as this store.

The given passphrase will be used to encrypt private data.

Source

pub async fn save_filter( &self, filter_name: &str, filter_id: &str, ) -> Result<(), SledStoreError>

Source

pub async fn get_filter( &self, filter_name: &str, ) -> Result<Option<String>, SledStoreError>

Source

pub async fn get_sync_token(&self) -> Result<Option<String>, SledStoreError>

Source

pub async fn save_changes( &self, changes: &StateChanges, ) -> Result<(), SledStoreError>

Source

pub async fn get_presence_event( &self, user_id: &UserId, ) -> Result<Option<Raw<PresenceEvent>>, SledStoreError>

Source

pub async fn get_state_event( &self, room_id: &RoomId, event_type: StateEventType, state_key: &str, ) -> Result<Option<Raw<AnySyncStateEvent>>, SledStoreError>

Source

pub async fn get_state_events( &self, room_id: &RoomId, event_type: StateEventType, ) -> Result<Vec<Raw<AnySyncStateEvent>>, SledStoreError>

Source

pub async fn get_profile( &self, room_id: &RoomId, user_id: &UserId, ) -> Result<Option<MinimalStateEvent<RoomMemberEventContent>>, SledStoreError>

Source

pub async fn get_member_event( &self, room_id: &RoomId, state_key: &UserId, ) -> Result<Option<MemberEvent>, SledStoreError>

Source

pub async fn get_user_ids_stream( &self, room_id: &RoomId, ) -> StoreResult<impl Stream<Item = StoreResult<OwnedUserId>>>

Source

pub async fn get_stripped_user_ids_stream( &self, room_id: &RoomId, ) -> StoreResult<impl Stream<Item = StoreResult<OwnedUserId>>>

Source

pub async fn get_invited_user_ids( &self, room_id: &RoomId, ) -> StoreResult<impl Stream<Item = StoreResult<OwnedUserId>>>

Source

pub async fn get_joined_user_ids( &self, room_id: &RoomId, ) -> StoreResult<impl Stream<Item = StoreResult<OwnedUserId>>>

Source

pub async fn get_stripped_invited_user_ids( &self, room_id: &RoomId, ) -> StoreResult<impl Stream<Item = StoreResult<OwnedUserId>>>

Source

pub async fn get_stripped_joined_user_ids( &self, room_id: &RoomId, ) -> StoreResult<impl Stream<Item = StoreResult<OwnedUserId>>>

Source

pub async fn get_room_infos( &self, ) -> Result<impl Stream<Item = Result<RoomInfo, SledStoreError>>, SledStoreError>

Source

pub async fn get_stripped_room_infos( &self, ) -> Result<impl Stream<Item = Result<RoomInfo, SledStoreError>>, SledStoreError>

Source

pub async fn get_users_with_display_name( &self, room_id: &RoomId, display_name: &str, ) -> Result<BTreeSet<OwnedUserId>, SledStoreError>

Source

pub async fn get_account_data_event( &self, event_type: GlobalAccountDataEventType, ) -> Result<Option<Raw<AnyGlobalAccountDataEvent>>, SledStoreError>

Source

pub async fn get_room_account_data_event( &self, room_id: &RoomId, event_type: RoomAccountDataEventType, ) -> Result<Option<Raw<AnyRoomAccountDataEvent>>, SledStoreError>

Trait Implementations§

Source§

impl Clone for SledStateStore

Source§

fn clone(&self) -> SledStateStore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SledStateStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StateStore for SledStateStore

Source§

fn save_filter<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, filter_name: &'life1 str, filter_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Save the given filter id under the given name. Read more
Source§

fn save_changes<'life0, 'life1, 'async_trait>( &'life0 self, changes: &'life1 StateChanges, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save the set of state changes in the store.
Source§

fn get_filter<'life0, 'life1, 'async_trait>( &'life0 self, filter_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the filter id that was stored under the given filter name. Read more
Source§

fn get_sync_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the last stored sync token.
Source§

fn get_presence_event<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Raw<PresenceEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the stored presence event for the given user. Read more
Source§

fn get_state_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, state_key: &'life2 str, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Raw<AnySyncStateEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get a state event out of the state store. Read more
Source§

fn get_state_events<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: StateEventType, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<Raw<AnySyncStateEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a list of state events for a given room and StateEventType. Read more
Source§

fn get_profile<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, user_id: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<MinimalStateEvent<RoomMemberEventContent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the current profile for the given user in the given room. Read more
Source§

fn get_member_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, state_key: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<MemberEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the MemberEvent for the given state key in the given room id. Read more
Source§

fn get_user_ids<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<OwnedUserId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all the user ids of members for a given room, for stripped and regular rooms alike.
Source§

fn get_invited_user_ids<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<OwnedUserId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all the user ids of members that are in the invited state for a given room, for stripped and regular rooms alike.
Source§

fn get_joined_user_ids<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<OwnedUserId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all the user ids of members that are in the joined state for a given room, for stripped and regular rooms alike.
Source§

fn get_room_infos<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<RoomInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all the pure RoomInfos the store knows about.
Source§

fn get_stripped_room_infos<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<RoomInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all the pure RoomInfos the store knows about.
Source§

fn get_users_with_display_name<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, display_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = StoreResult<BTreeSet<OwnedUserId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get all the users that use the given display name in the given room. Read more
Source§

fn get_account_data_event<'life0, 'async_trait>( &'life0 self, event_type: GlobalAccountDataEventType, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Raw<AnyGlobalAccountDataEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get an event out of the account data store. Read more
Source§

fn get_room_account_data_event<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, event_type: RoomAccountDataEventType, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Raw<AnyRoomAccountDataEvent>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get an event out of the room account data store. Read more
Source§

fn get_user_room_receipt_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, receipt_type: ReceiptType, user_id: &'life2 UserId, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<(OwnedEventId, Receipt)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get an event out of the user room receipt store. Read more
Source§

fn get_event_room_receipt_events<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, receipt_type: ReceiptType, event_id: &'life2 EventId, ) -> Pin<Box<dyn Future<Output = StoreResult<Vec<(OwnedUserId, Receipt)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get events out of the event room receipt store. Read more
Source§

fn get_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get arbitrary data from the custom store Read more
Source§

fn set_custom_value<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], value: Vec<u8>, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Put arbitrary data into the custom store Read more
Source§

fn add_media_content<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 MediaRequest, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a media file’s content in the media store. Read more
Source§

fn get_media_content<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 MediaRequest, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a media file’s content out of the media store. Read more
Source§

fn remove_media_content<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 MediaRequest, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Removes a media file’s content from the media store. Read more
Source§

fn remove_media_content_for_uri<'life0, 'life1, 'async_trait>( &'life0 self, uri: &'life1 MxcUri, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Removes all the media files’ content associated to an MxcUri from the media store. Read more
Source§

fn remove_room<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Removes a room and all elements associated from the state store. Read more
Source§

fn room_timeline<'life0, 'life1, 'async_trait>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = StoreResult<Option<(BoxStream<StoreResult<SyncTimelineEvent>>, Option<String>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a stream of the stored timeline Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoStateStore for T
where T: StateStore + 'static,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StateStoreExt for T
where T: StateStore + ?Sized,

Source§

fn get_state_event_static<'life0, 'life1, 'async_trait, C>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<SyncStateEvent<C>>>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, C: StaticEventContent + StateEventContent<StateKey = EmptyStateKey> + RedactContent + 'async_trait, <C as RedactContent>::Redacted: RedactedStateEventContent + DeserializeOwned, Self: Sync + 'async_trait,

Get a specific state event of statically-known type. Read more
Source§

fn get_state_event_static_for_key<'life0, 'life1, 'life2, 'async_trait, C, K>( &'life0 self, room_id: &'life1 RoomId, state_key: &'life2 K, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<SyncStateEvent<C>>>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, C: StaticEventContent + StateEventContent + RedactContent + 'async_trait, <C as StateEventContent>::StateKey: Borrow<K>, <C as RedactContent>::Redacted: RedactedStateEventContent, K: AsRef<str> + Sync + 'async_trait + ?Sized, Self: Sync + 'async_trait,

Get a specific state event of statically-known type. Read more
Source§

fn get_state_events_static<'life0, 'life1, 'async_trait, C>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Vec<Raw<SyncStateEvent<C>>>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, C: StaticEventContent + StateEventContent + RedactContent + 'async_trait, <C as RedactContent>::Redacted: RedactedStateEventContent, Self: Sync + 'async_trait,

Get a list of state events of a statically-known type for a given room. Read more
Source§

fn get_account_data_event_static<'life0, 'async_trait, C>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<GlobalAccountDataEvent<C>>>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, C: StaticEventContent + GlobalAccountDataEventContent + 'async_trait, Self: Sync + 'async_trait,

Get an event of a statically-known type from the account data store.
Source§

fn get_room_account_data_event_static<'life0, 'life1, 'async_trait, C>( &'life0 self, room_id: &'life1 RoomId, ) -> Pin<Box<dyn Future<Output = Result<Option<Raw<RoomAccountDataEvent<C>>>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, C: StaticEventContent + RoomAccountDataEventContent + 'async_trait, Self: Sync + 'async_trait,

Get an event of a statically-known type from the room account data store. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AsyncTraitDeps for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> SendOutsideWasm for T
where T: Send,

Source§

impl<T> SyncOutsideWasm for T
where T: Sync,