pub struct HostDocument { /* private fields */ }Implementations§
Trait Implementations§
Source§impl SettingsSource for HostDocument
impl SettingsSource for HostDocument
fn load(&self) -> Map<String, Value>
fn update_section(&self, name: &str, values: Map<String, Value>) -> Result<()>
Source§fn update_section_with(
&self,
name: &str,
_origin: &ChangeOrigin,
change: &mut SectionChange<'_>,
) -> Result<()>
fn update_section_with( &self, name: &str, _origin: &ChangeOrigin, change: &mut SectionChange<'_>, ) -> Result<()>
Read section
name and merge what change makes of it, recording
origin, as one step no other write to this source lands inside.
This is the read-modify-write behind a typed key’s update: a toggle
pressed twice in quick succession flips twice. Read moreSource§fn update_sections(
&self,
sections: Vec<(String, Map<String, Value>)>,
_origin: &ChangeOrigin,
) -> Result<()>
fn update_sections( &self, sections: Vec<(String, Map<String, Value>)>, _origin: &ChangeOrigin, ) -> Result<()>
Merge each of
sections as one change made by origin: one step history takes back
together, a choice spanning sections (the model agents answer with) included. Read moreSource§fn compare_update_sections(
&self,
expected: &[(&str, Map<String, Value>)],
sections: Vec<(String, Map<String, Value>)>,
_origin: &ChangeOrigin,
) -> Result<ConditionalUpdate>
fn compare_update_sections( &self, expected: &[(&str, Map<String, Value>)], sections: Vec<(String, Map<String, Value>)>, _origin: &ChangeOrigin, ) -> Result<ConditionalUpdate>
Self::update_sections, only if each of expected (a section, and what it held when
the caller read it) still holds what it did. Superseded means a newer change replaced
what the caller read. Read morefn revision(&self) -> u64
Source§fn changes(&self) -> &ChangeSignal
fn changes(&self) -> &ChangeSignal
Rings every time
Self::revision changes, so a reader waiting for
a change wakes at once instead of looking again and again.fn update_section_by( &self, name: &str, values: Map<String, Value>, origin: &ChangeOrigin, ) -> Result<()>
Source§fn readonly_refusal(
&self,
_name: &str,
_values: &Map<String, Value>,
) -> Option<String>
fn readonly_refusal( &self, _name: &str, _values: &Map<String, Value>, ) -> Option<String>
Why writing
values to section name is refused — a field the section declares read only
would change — asked before the settings channel writes an app’s values there. The field
is changed by the action a section declares and by nothing else, so no app’s write reaches
it. None from a source that keeps no such declarations.Source§fn step(
&self,
_section: &str,
_app: Option<&str>,
_undo: bool,
_invokers: &[String],
) -> Result<bool>
fn step( &self, _section: &str, _app: Option<&str>, _undo: bool, _invokers: &[String], ) -> Result<bool>
Take back (
undo) or bring back the last step any of invokers (actors, as a change
names them) took on section section, of the app app where the section keeps each
app’s preferences apart. Whether there was one. Read moreSource§fn stamps(&self, _section: &str) -> Result<Vec<Stamp>>
fn stamps(&self, _section: &str) -> Result<Vec<Stamp>>
The changes of section
section, oldest first, each as the stamp it carries in the
settings’ history (or will, once written): which setter set what, and who invoked it. Read morefn flush_pending(&self)
fn take_deferred_failures(&self) -> Vec<DeferredFailure>
Auto Trait Implementations§
impl !Freeze for HostDocument
impl !RefUnwindSafe for HostDocument
impl !UnwindSafe for HostDocument
impl Forget for HostDocument
impl Move for HostDocument
impl Send for HostDocument
impl Sync for HostDocument
impl Unpin for HostDocumentwhere
Align4<u32>: Unpin,
Align1<u8>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
Align8<u64>: Unpin,
Box<dyn Fn(&Map<String, Value>) -> Result<(), Error> + Sync + Send>: Unpin,
*const u8 is !null: Unpin,
*const ArcInner<dyn Fn() + Sync + Send> is !null: Unpin,
impl UnsafeUnpin for HostDocumentwhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
Align8<u64>: UnsafeUnpin,
*const dyn Fn(&Map<String, Value>) -> Result<(), Error> + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Fn(&Map<String, Value>) -> Result<(), Error> + Sync + Send>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Weak<dyn Fn() + Sync + Send>>: UnsafeUnpin,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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