pub struct WorkspaceRecord<P: Resource> { /* private fields */ }Expand description
A record every app of the window’s workspace opens, held for the window
(RecordEnv::workspace).
Implementations§
Source§impl<P: Resource> WorkspaceRecord<P>
impl<P: Resource> WorkspaceRecord<P>
Sourcepub fn open(
records: &WorkspaceRecords,
owner: &'static str,
app: (&'static str, &'static str),
permissions: Option<LivePermissions>,
wake: Option<WakeHandle>,
) -> Option<Self>
pub fn open( records: &WorkspaceRecords, owner: &'static str, app: (&'static str, &'static str), permissions: Option<LivePermissions>, wake: Option<WakeHandle>, ) -> Option<Self>
The record P that owner keeps in the workspace records opens,
created with the resource’s genesis where nothing holds it yet and
brought to its version: what an app window holds
(RecordEnv::workspace), and what a
host that is no app window (the session’s workspace settings) opens
the same way. Changes are attributed to app (its id and title) and,
where the host knows the workspace’s grants as permissions, decided by
them first; wake is woken when another replica’s change arrives.
Sourcepub fn open_at(
records: &WorkspaceRecords,
owner: &'static str,
id: &str,
app: (&'static str, &'static str),
permissions: Option<LivePermissions>,
wake: Option<WakeHandle>,
) -> Option<Self>
pub fn open_at( records: &WorkspaceRecords, owner: &'static str, id: &str, app: (&'static str, &'static str), permissions: Option<LivePermissions>, wake: Option<WakeHandle>, ) -> Option<Self>
Self::open of the record id of kind P that owner keeps:
a record of the owner’s that the workspace names otherwise than
Self::open’s, such as a conversation’s, which the two people it
is between name. The workspace’s grants decide its changes like any
other.
Sourcepub fn open_primary(
records: &WorkspaceRecords,
owner: &'static str,
app: (&'static str, &'static str),
permissions: Option<LivePermissions>,
wake: Option<WakeHandle>,
) -> Option<Self>
pub fn open_primary( records: &WorkspaceRecords, owner: &'static str, app: (&'static str, &'static str), permissions: Option<LivePermissions>, wake: Option<WakeHandle>, ) -> Option<Self>
Self::open_at of the record owner keeps as its own primary one of
P::KIND in the workspace: the record an app keeps as itself (Chat’s
of its chat, chat.workspace), which open_record cannot open because
the package’s primary id is a sentinel no [RecordId::parse] accepts.
An app’s own window opens it this way; so does the session, reading the
conversations its agents answer in.
Sourcepub fn may(&self, verb: &str) -> bool
pub fn may(&self, verb: &str) -> bool
Whether the workspace’s grants let the person invoke the verb verb of
the record, as its owner publishes it. A window that knows nothing
of the workspace’s grants (a test host) lets the record decide.
Sourcepub fn invoke(&self, invoke: &Invoke<P>) -> Result<(), ActionError>
pub fn invoke(&self, invoke: &Invoke<P>) -> Result<(), ActionError>
Apply the action invoke names: decided by the workspace’s grants on the
owner’s node, then one change of the record, attributed to the
person, in its history and one undo step of theirs.
§Errors
The arguments do not build the action, the grants refuse it, the
record does, or the record cannot be changed right now (for that,
Self::invoke_then waits).
Sourcepub fn invoke_then(
&self,
invoke: &Invoke<P>,
then: impl FnOnce(Result<(), ActionError>) + 'static,
)
pub fn invoke_then( &self, invoke: &Invoke<P>, then: impl FnOnce(Result<(), ActionError>) + 'static, )
Self::invoke, and then with what became of it: at once, or,
where the record cannot be changed right now (its store in use by
whatever runs as this is asked), once it can, on a refresh of the
window. Actions that wait are applied in the order they were asked
for, after the ones that waited before them.
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 WorkspaceRecord<P>
impl<P> !RefUnwindSafe for WorkspaceRecord<P>
impl<P> !Send for WorkspaceRecord<P>
impl<P> !Sync for WorkspaceRecord<P>
impl<P> Unpin for WorkspaceRecord<P>
impl<P> UnsafeUnpin for WorkspaceRecord<P>
impl<P> !UnwindSafe for WorkspaceRecord<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