Skip to main content

WorkspaceRecord

Struct WorkspaceRecord 

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

Source

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.

Source

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.

Source

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.

Source

pub fn id(&self) -> &RecordId

The record’s id, which names it in the workspace.

Source

pub fn get(&self) -> Rc<P::State>

The current state.

Source

pub fn revision(&self) -> u64

Increases whenever the state changes.

Source

pub fn me(&self) -> &str

The person who acts here.

Source

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.

Source

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

Source

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.

Source

pub fn record(&self) -> &StoredRecord

The record underneath, for a test or host that carries it between devices itself.

Trait Implementations§

Source§

impl<P: Resource> Clone for WorkspaceRecord<P>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,