pub struct PreferenceEntity<'conn, C>where
C: Deref<Target = Connection>,{ /* private fields */ }Available on crate feature
preferences only.Expand description
Preferences entity.
Implementations§
Source§impl<'conn, C> PreferenceEntity<'conn, C>where
C: Deref<Target = Connection>,
impl<'conn, C> PreferenceEntity<'conn, C>where
C: Deref<Target = Connection>,
Sourcepub fn find_optional(
&self,
account_id: Option<i64>,
key: &str,
) -> Result<Option<PreferenceRow>, SqlError>
pub fn find_optional( &self, account_id: Option<i64>, key: &str, ) -> Result<Option<PreferenceRow>, SqlError>
Find a preference in the database.
Sourcepub fn load_preferences(
&self,
account_id: Option<i64>,
) -> Result<Vec<PreferenceRow>, Error>
pub fn load_preferences( &self, account_id: Option<i64>, ) -> Result<Vec<PreferenceRow>, Error>
Load preferences from the database.
When no account_id is specified the preferences
are global.
Sourcepub fn insert_preference(
&self,
account_id: Option<i64>,
row: &PreferenceRow,
) -> Result<(), SqlError>
pub fn insert_preference( &self, account_id: Option<i64>, row: &PreferenceRow, ) -> Result<(), SqlError>
Create preferences in the database.
When no account_id is specified the preferences
are global.
Sourcepub fn insert_preferences(
&self,
account_id: Option<i64>,
rows: &[PreferenceRow],
) -> Result<(), SqlError>
pub fn insert_preferences( &self, account_id: Option<i64>, rows: &[PreferenceRow], ) -> Result<(), SqlError>
Create preferences in the database.
When no account_id is specified the preferences
are global.
Sourcepub fn update_preference(
&self,
account_id: Option<i64>,
row: &PreferenceRow,
) -> Result<(), SqlError>
pub fn update_preference( &self, account_id: Option<i64>, row: &PreferenceRow, ) -> Result<(), SqlError>
Update preference in the database.
When no account_id is specified the preferences
are global.
Sourcepub fn upsert_preference(
&self,
account_id: Option<i64>,
row: &PreferenceRow,
) -> Result<(), SqlError>
pub fn upsert_preference( &self, account_id: Option<i64>, row: &PreferenceRow, ) -> Result<(), SqlError>
Create or update preferences in the database.
When no account_id is specified the preferences
are global.
Auto Trait Implementations§
impl<'conn, C> Freeze for PreferenceEntity<'conn, C>
impl<'conn, C> RefUnwindSafe for PreferenceEntity<'conn, C>where
C: RefUnwindSafe,
impl<'conn, C> Send for PreferenceEntity<'conn, C>where
C: Sync,
impl<'conn, C> Sync for PreferenceEntity<'conn, C>where
C: Sync,
impl<'conn, C> Unpin for PreferenceEntity<'conn, C>
impl<'conn, C> UnwindSafe for PreferenceEntity<'conn, C>where
C: RefUnwindSafe,
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