Op

Enum Op 

Source
pub enum Op {
Show 13 variants Ingress, Presence, Awareness { f: Core, }, Freshness, Decide { validate: Core, }, Fold { step: Core, init: Core, }, Gestures { step: Core, init: Core, }, Durable, Map { f: Core, }, Map2 { f: Core, }, PerSession { f: Core, }, FilterMap { f: Core, }, Alias,
}
Expand description

What a vertex does. One variant per construct in §3.7’s signal vocabulary.

Variants§

§

Ingress

merge_clients() — the one place time and nondeterminism enter.

§

Presence

presence() — who is connected now.

A source like Op::Ingress and a Signal rather than a Stream: connections are a value defined at all times, not occurrences. It is the only vertex here that is neither the log nor derived from it, which is the one fact everything else about it follows from — see crate::split for what that forbids and crate::plan for what it costs.

§

Awareness

awareness(f) — every subscriber’s f(session), keyed by actor.

A source for Op::Presence’s reason and with its rules: the runtime holds every connection’s Session, so it computes each contribution itself and this vertex reads what it publishes. f is carried here rather than being a signal input because there is no signal to read — the subscribers are the runtime’s fact, not the graph’s.

Fields

§

Freshness

freshness() — whether what is about to be rendered is confirmed or a guess.

A source like Op::Presence, and the other one that is not the log. The difference is which side holds it: presence is the server’s fact about its sockets, freshness is the client’s fact about its own unacknowledged commands — so this one is refused to a page that renders on the server (crate::render) where presence is refused to a page that renders on the client.

§

Decide

decide(proposals, state, validate) — §3.5’s authority chokepoint, as a node.

Fields

§validate: Core
§

Fold

fold(step, init, stream). The accumulator, and the point at which a cycle bottoms out.

Fields

§step: Core
§init: Core
§

Gestures

gestures(step, init) — D30’s non-durable fold, and a source like Op::Presence.

A source rather than an operator over one, because the stream it folds has no other consumer it could have: a gesture is this client’s and the graph has nothing else on that side of the seam. So the step and the initial value are carried here for Op::Awareness’s reason — there is no signal to read — and the vertex has no inputs, which is what makes the accumulator unreachable from the log by construction rather than by a rule.

Fields

§step: Core
§init: Core
§

Durable

durable(signal) — the accumulator that survives a restart, and therefore the one the log is of.

§

Map

signal_map(s, f).

Fields

§

Map2

map2(f, a, b).

Fields

§

PerSession

per_session(s, f) — §3.8’s fanout point, first-class so that Phase 3 can share the arrangement above it.

Fields

§

FilterMap

filter_map(s, f) on a stream.

Fields

§

Alias

A signal declared as another signal: mirror: Signal[T] = todos.

Implementations§

Source§

impl Op

Source

pub fn name(&self) -> &'static str

Source

pub fn is_stream(&self) -> bool

Whether this vertex carries a Stream rather than a Signal — occurrences rather than a value defined at all times (§3.7). A view is a function of signals, so a stream vertex on a view’s path is an error rather than a missing feature.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Op

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Op

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnwindSafe for Op

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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