pub struct PersonRecord<P: Resource> { /* private fields */ }Expand description
A record the app keeps beside the one it shows: one per resource kind
and app in the workspace the app is open in, the same on every device,
so it reaches the person’s other devices with the workspace. What was
watched, the words taught to the keyboard, where reading stopped. Or
one of the person’s shared records another app keeps
(tilo_resource::SharedRecord). The shared ones belong to the person
rather than to a workspace, so they are kept in the person’s own scope and
stay on this device until their personal store carries them.
It is a resource like the app’s own: its edits are its actions, applied
by the replayable executor, attributed to the person, written into its
history and undone per step (Self::undo). It is created with the
resource’s genesis (Resource::initialize) where it does not exist
yet. Read it through Self::state or Self::with; an edit from
another window or device reaches it on the next frame.
Implementations§
Source§impl<P: Resource> PersonRecord<P>
impl<P: Resource> PersonRecord<P>
Sourcepub fn unreadable(&self) -> Option<String>
pub fn unreadable(&self) -> Option<String>
Why the record stopped reading as P, if it did: the state is then
the last one that read, and a view shows this instead of it. Its
published actions say the same.
Sourcepub fn state(&self) -> LocalState<Rc<P::State>>
pub fn state(&self) -> LocalState<Rc<P::State>>
The state as view state that follows every change, for a control bound to it.
Sourcepub fn apply(&self, action: &P::Action) -> Result<(), ActionError>
pub fn apply(&self, action: &P::Action) -> Result<(), ActionError>
Apply action now: one change of the record, attributed to the
person, recorded in its history and — for content the person made —
one undo step of theirs.
Sourcepub fn invoke(&self, invoke: &Invoke<P>) -> Result<(), ActionError>
pub fn invoke(&self, invoke: &Invoke<P>) -> Result<(), ActionError>
Apply the action invoke names, as Self::apply.
Sourcepub fn editable(&self) -> bool
pub fn editable(&self) -> bool
Whether this app changes the record: its own, or a shared one it is an editor of; any other is read here.
Sourcepub fn syncs(&self) -> bool
pub fn syncs(&self) -> bool
Whether the record reaches other devices: it has a route. One kept on this device only has none.
Sourcepub fn content(&self) -> Option<ContentStore>
pub fn content(&self) -> Option<ContentStore>
Where the content this record references — a picture its state
names by hash — is stored and read: with the record, carried on its
route. None for a record kept on this device only, which keeps no
content.
Sourcepub fn record(&self) -> &StoredRecord
pub fn record(&self) -> &StoredRecord
The record underneath, for a test or host that carries it between devices itself.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for PersonRecord<P>
impl<P> !RefUnwindSafe for PersonRecord<P>
impl<P> !Send for PersonRecord<P>
impl<P> !Sync for PersonRecord<P>
impl<P> Unpin for PersonRecord<P>
impl<P> UnsafeUnpin for PersonRecord<P>
impl<P> !UnwindSafe for PersonRecord<P>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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