pub struct PreferenceProvider<E>{ /* private fields */ }Available on crate feature
preferences only.Expand description
Store preferences in a database table.
Implementations§
Trait Implementations§
Source§impl<E> PreferencesStorage for PreferenceProvider<E>
impl<E> PreferencesStorage for PreferenceProvider<E>
Source§fn load_preferences<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: Option<&'life1 AccountId>,
) -> Pin<Box<dyn Future<Output = Result<PreferenceMap, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_preferences<'life0, 'life1, 'async_trait>(
&'life0 self,
account_id: Option<&'life1 AccountId>,
) -> Pin<Box<dyn Future<Output = Result<PreferenceMap, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load preferences from storage.
Source§fn insert_preference<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
account_id: Option<&'life1 AccountId>,
key: &'life2 str,
pref: &'life3 Preference,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn insert_preference<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
account_id: Option<&'life1 AccountId>,
key: &'life2 str,
pref: &'life3 Preference,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Insert preference into storage.
Source§fn remove_preference<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
account_id: Option<&'life1 AccountId>,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_preference<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
account_id: Option<&'life1 AccountId>,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove preference from storage.
Auto Trait Implementations§
impl<E> Freeze for PreferenceProvider<E>
impl<E> RefUnwindSafe for PreferenceProvider<E>where
E: RefUnwindSafe,
impl<E> Send for PreferenceProvider<E>
impl<E> Sync for PreferenceProvider<E>
impl<E> Unpin for PreferenceProvider<E>where
E: Unpin,
impl<E> UnwindSafe for PreferenceProvider<E>where
E: 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