pub struct SettingsService {
repo: Arc<dyn SettingsRepository>,
}Expand description
Service for settings operations.
Fields§
§repo: Arc<dyn SettingsRepository>Implementations§
Source§impl SettingsService
impl SettingsService
Sourcepub fn new(repo: Arc<dyn SettingsRepository>) -> Self
pub fn new(repo: Arc<dyn SettingsRepository>) -> Self
Create a new settings service.
Sourcepub fn repo(&self) -> Arc<dyn SettingsRepository> ⓘ
pub fn repo(&self) -> Arc<dyn SettingsRepository> ⓘ
Return the underlying settings repository.
Sourcepub async fn update(
&self,
update: SettingsUpdate,
) -> Result<Settings, CoreError>
pub async fn update( &self, update: SettingsUpdate, ) -> Result<Settings, CoreError>
Update settings with partial changes.
The merge and the validation run on the settings as they stand when
the update is written, not as they stood at some earlier read: the
repository reads, applies and stores in one step
(SettingsRepository::modify). A field this update does not set is
left as its last writer left it, whichever process that was.
Auto Trait Implementations§
impl Freeze for SettingsService
impl !RefUnwindSafe for SettingsService
impl Send for SettingsService
impl Sync for SettingsService
impl Unpin for SettingsService
impl UnsafeUnpin for SettingsService
impl !UnwindSafe for SettingsService
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