Skip to main content

SettingsRecords

Struct SettingsRecords 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn shared<P: SharedRecord>(&self) -> Option<PersonRecord<P>>

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.

Source

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.

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,