pub struct SettingsRecords { /* private fields */ }Expand description
The settings sections an app keeps as records, held by a host without a window: the session, which keeps them for the palette and agents whether or not the app is open. Each is published and changed as the app’s window does it, so a change checks the section’s model and is recorded in the settings document with what made it and who; admitting an invocation (the invoker’s grants) is the caller’s, from the published action.
Implementations§
Source§impl SettingsRecords
impl SettingsRecords
Sourcepub fn new(app_id: &'static str, declare: Declare) -> Self
pub fn new(app_id: &'static str, declare: Declare) -> Self
The settings sections declare declares, of the app app_id, as
they are stored now.
Sourcepub fn in_document(
app_id: &'static str,
declares: &[Declare],
document: SettingsDocument,
) -> Self
pub fn in_document( app_id: &'static str, declares: &[Declare], document: SettingsDocument, ) -> Self
The settings sections declares declare, of the app app_id, as
document stores them.
Sourcepub fn of_person(
app_id: &'static str,
app_title: &'static str,
declares: &[Declare],
records: PersonRecords,
) -> Self
pub fn of_person( app_id: &'static str, app_title: &'static str, declares: &[Declare], records: PersonRecords, ) -> Self
The settings sections declares declare, of the app app_id (titled
app_title), as the app’s window keeps them for the person whose
records hold their shared records: each change is stored in the
session’s settings document with what made it and who, and is a step
of its invoker’s, undone and redone like any of theirs.
Sourcepub fn of_person_named(
app_id: &'static str,
app_title: &'static str,
person: &str,
earlier: &[String],
declares: &[Declare],
) -> Self
pub fn of_person_named( app_id: &'static str, app_title: &'static str, person: &str, earlier: &[String], declares: &[Declare], ) -> Self
The settings sections declares declare, of the app app_id (titled
app_title), changed by person: each change is stored in the
session’s settings document with what made it and who, and is a step
of its invoker’s, undone and redone like any of theirs. earlier
are the ids they went by before this device had an identity: what
was changed under one is theirs to take back. The sections’ history
is the settings document’s, so the host holds no person records
beside them.
Sourcepub fn history_owners(&self) -> Vec<HistoryOwner>
pub fn history_owners(&self) -> Vec<HistoryOwner>
The person’s shared records held beside the sections
(Self::shared), which the runtime holds for the person; none
where no person is.
The person’s shared record P (their accounts, their contacts),
kept in the person’s own scope
(Self::history_owners), opened on first use; not published here.
None where no person is.
Sourcepub fn resources(&self) -> Vec<ResourceSpec>
pub fn resources(&self) -> Vec<ResourceSpec>
Every section, published with its field edits and verbs, and with the undo and redo of its invoker’s steps where a person is.
Sourcepub fn stored(&self, kind: &str) -> Option<Value>
pub fn stored(&self, kind: &str) -> Option<Value>
The section kind (settings.appearance) as stored now, as its
model writes it: what a control showing one of its fields shows.
None for a section not declared here.
Sourcepub fn invoke(
&self,
address: &ActionAddress,
arguments: &Map<String, Value>,
confirmed: bool,
invoker: &ActionInvoker,
invoked_by: Option<&InvokingAction>,
) -> Result<ActionOutput, DoorError>
pub fn invoke( &self, address: &ActionAddress, arguments: &Map<String, Value>, confirmed: bool, invoker: &ActionInvoker, invoked_by: Option<&InvokingAction>, ) -> Result<ActionOutput, DoorError>
Run the action at address with its typed arguments for invoker,
on behalf of the action invoked_by when another action runs it
(the palette’s dark mode runs the appearance field edit). The change
is recorded with both, so its history tells them apart. A change
whose published action asks first, for the value it carries (a later
lock), runs only once it is confirmed.
Auto Trait Implementations§
impl Freeze for SettingsRecords
impl !RefUnwindSafe for SettingsRecords
impl !Send for SettingsRecords
impl !Sync for SettingsRecords
impl Unpin for SettingsRecords
impl UnsafeUnpin for SettingsRecords
impl !UnwindSafe for SettingsRecords
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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