Struct WorkspaceRecords
pub struct WorkspaceRecords { /* private fields */ }Expand description
Where a window opens the records every app of its workspace opens. Cloning shares them.
Implementations§
§impl WorkspaceRecords
impl WorkspaceRecords
pub fn in_workspace(
owners: RecordOwners,
workspace: String,
author: UserId,
) -> WorkspaceRecords
pub fn in_workspace( owners: RecordOwners, workspace: String, author: UserId, ) -> WorkspaceRecords
The records of workspace that owners keep: one writer per app and
workspace, shared with the owner’s own windows in this process.
pub fn new(
author: UserId,
open: impl Fn(&str) -> Result<RecordStore, RecordOpenError> + 'static,
) -> WorkspaceRecords
pub fn new( author: UserId, open: impl Fn(&str) -> Result<RecordStore, RecordOpenError> + 'static, ) -> WorkspaceRecords
The workspace’s records, in the store open opens for the app that keeps
them: a host that syncs each store it hands out (the browser’s page)
notes it there.
pub fn open_record(
&self,
owner: &str,
kind: &str,
initialize: &dyn Fn(&mut AutoCommit) -> Result<(), String>,
) -> Result<StoredRecord, RecordOpenError>
pub fn open_record( &self, owner: &str, kind: &str, initialize: &dyn Fn(&mut AutoCommit) -> Result<(), String>, ) -> Result<StoredRecord, RecordOpenError>
The record of kind that owner keeps in the workspace, created with
initialize (its genesis, the same change on every device) where
nothing holds it yet.
§Errors
The pair is no workspace record, or the record could not be read or created.
pub fn open_record_at(
&self,
owner: &str,
id: &str,
kind: &str,
initialize: &dyn Fn(&mut AutoCommit) -> Result<(), String>,
) -> Result<StoredRecord, RecordOpenError>
pub fn open_record_at( &self, owner: &str, id: &str, kind: &str, initialize: &dyn Fn(&mut AutoCommit) -> Result<(), String>, ) -> Result<StoredRecord, RecordOpenError>
The record id of kind that owner keeps in the workspace, created
with initialize where nothing holds it yet, whatever names it: a
conversation’s record is one, named by the two people it is between.
The workspace’s grants on the owner’s node decide every change to it
like any other record of the owner’s.
§Errors
id names no record, or the record could not be read or created.
pub fn open_primary(
&self,
owner: &str,
kind: &str,
initialize: &dyn Fn(&mut AutoCommit) -> Result<(), String>,
) -> Result<StoredRecord, RecordOpenError>
pub fn open_primary( &self, owner: &str, kind: &str, initialize: &dyn Fn(&mut AutoCommit) -> Result<(), String>, ) -> Result<StoredRecord, RecordOpenError>
The record owner keeps as its own primary record of kind: the
one record of a kind an app keeps in a workspace, under the owner’s
RecordId::package_primary (Chat’s of its chat, chat.workspace).
Self::open_record_at cannot open it, because the primary id is a
sentinel no RecordId::parse accepts; this is the same open with
the id taken as it is.
§Errors
The record could not be read or created.
pub fn holds_record(
&self,
owner: &str,
id: &str,
kind: &str,
) -> Result<bool, RecordOpenError>
pub fn holds_record( &self, owner: &str, id: &str, kind: &str, ) -> Result<bool, RecordOpenError>
Whether owner’s store holds the record id of kind, without
opening or creating it: a list asks this to show the records that
exist, not to make one for everything it could name.
§Errors
id names no record, or the record could not be read.
pub fn store_of(&self, owner: &str) -> Result<RecordStore, RecordOpenError>
pub fn store_of(&self, owner: &str) -> Result<RecordStore, RecordOpenError>
The store owner keeps its records of this workspace in: where a chain
kept beside one of them (RecordId::part) has its parts.
§Errors
Rejects a package or workspace that names no store.
Trait Implementations§
§impl Clone for WorkspaceRecords
impl Clone for WorkspaceRecords
§fn clone(&self) -> WorkspaceRecords
fn clone(&self) -> WorkspaceRecords
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for WorkspaceRecords
impl !RefUnwindSafe for WorkspaceRecords
impl !Send for WorkspaceRecords
impl !Sync for WorkspaceRecords
impl Unpin for WorkspaceRecords
impl UnsafeUnpin for WorkspaceRecords
impl !UnwindSafe for WorkspaceRecords
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