Skip to main content

NotesEvent

Enum NotesEvent 

Source
pub enum NotesEvent {
Show 41 variants Created { note: Note, }, Note { note: Note, }, Rows { items: Vec<NotesEvent>, }, Page { next: Option<String>, remaining: u64, }, Saved { id: String, revision: u32, at: i64, by: String, stale: bool, }, Applied { id: String, revision: u32, }, State { id: String, update: String, vector: String, revision: u32, }, Updated { id: String, seq: u32, update: String, at: i64, by: String, session: Option<String>, note: Option<Note>, }, Renamed { id: String, title: String, revision: u32, at: i64, by: String, note: Option<Note>, }, Deleted { id: String, at: i64, by: String, }, Squashed { id: String, until: u32, removed: u32, at: i64, by: String, }, Change { change: HistoryRow, }, Present { present: Present, }, Left { id: String, session: String, client: Option<u64>, }, Thread { thread: Thread, }, Asked { thread: Thread, }, Replied { thread: Thread, }, Resolved { thread: Thread, }, Mark { mark: Mark, }, Marked { mark: Mark, }, Unmarked { id: String, mark: String, }, MarkChanged { id: String, mark: Mark, }, MarkRemoved { id: String, mark: String, }, Text { id: String, revision: u32, body: String, by: String, at: i64, }, May { id: String, role: Role, held: bool, }, Watching { id: Option<String>, }, Lagged { missed: u64, }, WatchClosed { reason: WatchEnd, message: String, }, NotFound { id: Option<String>, revision: Option<u32>, org: Option<String>, thread: Option<String>, mark: Option<String>, }, Refused { reason: String, message: String, }, Slot { slot: Slot, }, Filled { slot: Slot, }, Emptied { slot: Slot, }, Building { slot: Slot, }, Props { slot: Slot, }, SlotChanged { id: String, slot: Slot, }, BuildingChanged { id: String, building: Option<Building>, slot: Slot, }, PropsChanged { id: String, props: Map<String, Value>, by: String, slot: Slot, }, Usage { principal: String, count: u64, bytes: u64, }, UsageDay { principal: String, day: i64, count: u64, bytes: u64, }, Error { message: String, },
}
Expand description

What the notes service streams.

Variants§

§

Created

create’s answer, and a watch’s word for a note made.

Fields

§note: Note
§

Note

get’s and replay’s answer: the note whole (as it stood then, for a replay).

Fields

§note: Note
§

Rows

A page of list’s rows at once: each item a note { note } without its body.

Fields

§

Page

Where a list walk stands, the last data event of the call: next is the cursor to pass as the next call’s after (null when nothing more matches); remaining counts the matches past this page.

Fields

§remaining: u64
§

Saved

save’s and restore’s answer: the body merged in as the CRDT’s own edits — the revision it made (none new when it changed nothing), when and by whom; stale when base was not the revision it found.

Fields

§revision: u32
§at: i64
§stale: bool
§

Applied

update’s answer: the update kept as change revision.

Fields

§revision: u32
§

State

state’s answer: what the caller’s state vector lacks (update, a Yjs v1 update, base64), the note’s own state vector (vector, base64), and its revision.

Fields

§update: String
§vector: String
§revision: u32
§

Updated

A watch’s word for every change of the body: the Yjs v1 update (base64) to apply, its seq, who and when, the presence session it came from when it said; note the note as it is now (without its body on a watch of every note).

Fields

§seq: u32
§update: String
§at: i64
§session: Option<String>
§note: Option<Note>
§

Renamed

rename’s answer, and a watch’s: the new title and the revision it made.

Fields

§title: String
§revision: u32
§at: i64
§note: Option<Note>
§

Deleted

delete’s answer, and a watch’s: the note is gone (its changes are kept in the file).

Fields

§at: i64
§

Squashed

squash’s answer, and a watch’s: the changes up to until are one snapshot now (removed rows fewer), who wrote what kept as its authors.

Fields

§until: u32
§removed: u32
§at: i64
§

Change

history’s rows, newest first.

Fields

§change: HistoryRow
§

Present

present’s rows, and a watch’s word: someone is on the note, or moved their caret.

Fields

§present: Present
§

Left

A watch’s word: someone left the note (client their Yjs client id, when said).

Fields

§session: String
§client: Option<u64>
§

Thread

V2-30: threads’ and waiting’s rows, a thread whole.

Fields

§thread: Thread
§

Asked

V2-30: ask’s answer, and a watch’s: a question asked on a range.

Fields

§thread: Thread
§

Replied

V2-30: reply’s answer, and a watch’s: the thread with its new answer.

Fields

§thread: Thread
§

Resolved

V2-30: resolve’s answer, and a watch’s: the thread folded (or opened again: resolved absent).

Fields

§thread: Thread
§

Mark

NOTES-5: marks’ rows, a mark whole.

Fields

§mark: Mark
§

Marked

NOTES-5: mark’s answer: the mark made, or changed.

Fields

§mark: Mark
§

Unmarked

NOTES-5: unmark’s answer: the mark mark is gone from the note id.

Fields

§mark: String
§

MarkChanged

NOTES-5: a watch’s word: a mark made or changed on the note id, whole.

Fields

§mark: Mark
§

MarkRemoved

NOTES-5: a watch’s word: the mark mark taken off the note id.

Fields

§mark: String
§

Text

NOTES-5: a watch’s word with text: true — the note’s markdown after a change (at most once a second, the last change always said), and once as the watch opens: its revision then, who wrote it last and when (unix seconds).

Fields

§revision: u32
§body: String
§at: i64
§

May

may’s answer: whether the caller holds role on the note id.

Fields

§role: Role
§held: bool
§

Watching

A watch is open: what it hears follows (id when it watches one note).

Fields

§

Lagged

A watch fell behind by missed writes: read again (state, list).

Fields

§missed: u64
§

WatchClosed

A watch ended: reason is signed_out, expired, revoked or refused.

Fields

§reason: WatchEnd
§message: String
§

NotFound

No such note, or none the caller may read (one answer); with revision, no such change kept (none, or squashed). org for an organization the caller is not in.

Fields

§revision: Option<u32>
§thread: Option<String>

V2-30: no such thread on the note.

§mark: Option<String>

NOTES-5: no such mark on the note.

§

Refused

The caller reads the note but may not do this to it (forbidden, message naming the grant and role it takes), or the meter refused the write (quota). Nothing was written.

Fields

§reason: String
§message: String
§

Slot

NOTES-4: slot’s answer: the note’s slot whole.

Fields

§slot: Slot
§

Filled

NOTES-4: fill’s answer: the slot with its new fill.

Fields

§slot: Slot
§

Emptied

NOTES-4: empty’s answer: the slot with nothing in it.

Fields

§slot: Slot
§

Building

NOTES-4: building’s answer: the slot with its build under way.

Fields

§slot: Slot
§

Props

NOTES-4: props’ answer: the slot with its props merged.

Fields

§slot: Slot
§

SlotChanged

NOTES-4: a watch’s word: the slot was filled or emptied — slot whole.

Fields

§slot: Slot
§

BuildingChanged

NOTES-4: a watch’s word: a build began, moved a step, failed or ended (building absent) — slot whole.

Fields

§building: Option<Building>
§slot: Slot
§

PropsChanged

NOTES-4: a watch’s word: the slot’s props, merged by by — slot whole.

Fields

§props: Map<String, Value>
§slot: Slot
§

Usage

V2-31: usage { everyone } — what one principal’s changes keep: the notes they made and the bytes they wrote.

Fields

§principal: String
§count: u64
§bytes: u64
§

UsageDay

V2-70: usage { everyone, daily } — what one principal’s changes kept on one UTC day (day: days since 1970-01-01).

Fields

§principal: String
§day: i64
§count: u64
§bytes: u64
§

Error

Any other in-band refusal, naming the problem; nothing was written.

Fields

§message: String

Implementations§

Source§

impl NotesEvent

Source

pub fn no_doc(id: &str) -> Self

not_found for the note id.

Trait Implementations§

Source§

impl Clone for NotesEvent

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

impl Debug for NotesEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NotesEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for NotesEvent

Source§

impl FromClientError for NotesEvent

Source§

fn from_client_error(error: ClientError) -> Self

The event that stands for error. It is the last item of its stream.
Source§

impl JsonSchema for NotesEvent

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for NotesEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for NotesEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for NotesEvent

Auto Trait Implementations§

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
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

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> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SettingValue for T
where T: Serialize + DeserializeOwned + JsonSchema + Clone + Send + Sync + 'static,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more