pub enum ResourceCopy {
Document(Vec<u8>),
Read(Value),
Reading {
value: Value,
revision: Option<String>,
},
Absent,
}Expand description
What a read of one record answers.
Variants§
Document(Vec<u8>)
The record’s committed content: an Automerge document, whole.
Read(Value)
The resource as its app’s package reads it: what the core read answers of it, who made each item and when included. A tilolang app’s records are read this way, never as the documents that keep them.
Reading
A resource the provider publishes itself rather than from an app’s record (device state, a
desktop’s windows and styles): its reading as the JSON its service reads, and the revision
it stands at when the provider names one. A provider with no revision of its own leaves it
None, and a reader’s revision is the hash of the JSON then.
Absent
The workspace holds no such record: nothing was ever written to it.
Implementations§
Source§impl ResourceCopy
impl ResourceCopy
Source§impl ResourceCopy
impl ResourceCopy
Sourcepub fn readable(&self) -> Result<Value, String>
pub fn readable(&self) -> Result<Value, String>
The record as any reader reads it, whatever app keeps it: its maps as objects, lists as
arrays, text as strings, counters and scalars as numbers, strings and booleans, bytes as
their count, a data enum as its $variant beside its fields by name; a reading as the JSON
its provider publishes; null for a record the workspace holds none of.
A rich text reads with its paragraphs as lists in their order, each paragraph with its
id, its kind, its words and its attributes, and without the key of bytes that places
it: its body, its page header and footer, a note’s and a comment’s lines, and what a
paragraph holds (tilo_automerge::rich_text). So every reader shows a text in order
and none orders it again.
§Errors
When the copy is no Automerge document, or is one this build reads none of (feature
document-read carries the reader).
Trait Implementations§
Source§impl Clone for ResourceCopy
impl Clone for ResourceCopy
Source§impl Debug for ResourceCopy
impl Debug for ResourceCopy
impl Eq for ResourceCopy
Source§impl PartialEq for ResourceCopy
impl PartialEq for ResourceCopy
impl StructuralPartialEq for ResourceCopy
Auto Trait Implementations§
impl Forget for ResourceCopy
impl Freeze for ResourceCopy
impl Move for ResourceCopy
impl RefUnwindSafe for ResourceCopy
impl Send for ResourceCopy
impl Sync for ResourceCopy
impl Unpin for ResourceCopy
impl UnsafeUnpin for ResourceCopy
impl UnwindSafe for ResourceCopy
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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