Skip to main content

Views

Struct Views 

Source
pub struct Views<T> { /* private fields */ }
Expand description

One provider’s views as one reader holds them, an interface each, with a Sequence per owner heartbeat key in front of them (freshness.v2 §2.5, text 0.9; #1110’s H2a). A heartbeat is still its interface’s view’s (Views::view_mut, View::apply); an owner heartbeat is read here (Views::apply_owner), since its sequence is its key’s and its groups are several views’.

  • Older and lost are per key. Each class’s key has one sequence. A gap on it is one owner heartbeat lost for every collection the key covers: those of the key’s class, in each interface a group on the key has named within the run (Views::lost). It says nothing of the other class’s key, nor of an interface confirmed by its own heartbeat.
  • Divergences are per collection. A collection has one count, its view’s, which a heartbeat’s section and a read group’s move alike.
  • A reader bound to one interface holds one view here, and reads the other groups as not followed, by their sizes.

Implementations§

Source§

impl<T: Arrival> Views<T>

Source

pub fn new() -> Self

No view, and no owner heartbeat read.

Source

pub fn insert(&mut self, view: View<T>) -> Option<View<T>>

Holds view as its interface’s, in place of any view held for it.

Source

pub fn view(&self, iface: &IfaceId) -> Option<&View<T>>

The view of an interface.

Source

pub fn view_mut(&mut self, iface: &IfaceId) -> Option<&mut View<T>>

The view of an interface, to hear a mutation, a read’s answer or the interface’s own heartbeat with.

Source

pub fn view_of(&self, key: &str) -> Option<&View<T>>

The view of the interface a state key is of, namespace in front or none.

Source

pub fn view_of_mut(&mut self, key: &str) -> Option<&mut View<T>>

As Views::view_of, to change it.

Source

pub fn iter(&self) -> impl Iterator<Item = &View<T>>

Every view, in order of its interface.

Source

pub fn classes(&self) -> Vec<Class>

The classes of the collections the views follow, link first: the provider’s owner heartbeat keys to subscribe to (v2 §2.5, “Both forms”).

Source

pub fn class_horizon(&self, class: Class) -> Option<Duration>

The horizon of the provider’s owner heartbeat key of class, as this reader can tell it (core §8.5): the shortest among the collections of that class in the revisions it holds a view of, None with none. A reader across a face declares the key’s subscription again after two of them of silence.

Source

pub fn apply_owner( &mut self, class: Class, tag: Tag, stamp: Stamp, body: &[u8], through: Catalogs<'_>, at: T, ) -> OwnerApplied

An owner heartbeat heard at at on the key of class: CH’s tag, its stamp and its body, read through the catalog its owner names among those the reader holds (through), by v2 §2.5’s steps.

  1. Refused: core §7.5 refuses it whole.
  2. Older: within one run, its seq is not after the last read one’s on this key.
  3. Read: each group alone, in order: no index (GroupRead::Refused), then as its interface’s view reads it (View::apply_group), not followed where no view is held for the interface. A group that confirms nothing takes nothing from the groups beside it.

One stopped at step 1 or 2 moves neither the key’s sequence nor a count of divergences, and names no interface.

Source

pub fn gap(&self, class: Class) -> Option<bool>

Whether the last owner heartbeat read on the key of class followed a gap in that key’s seqs; None while none was read on it.

Source

pub fn last(&self, class: Class) -> Option<Stamp>

The last owner heartbeat read on the key of class: its stamp.

Source

pub fn owner_heartbeats(&self, class: Class) -> u64

How many owner heartbeats were read on the key of class, whatever became of their groups.

Source

pub fn is_lost(&self, iface: &IfaceId, index: usize) -> bool

Whether the followed collection at index of iface is read as a lost delivery (v1 §2.5 rule 3): its interface’s heartbeat key’s last heartbeat followed a gap, or its class’s owner heartbeat key’s did and a group on that key has named the interface within the run. Until one arrives in sequence on that key, or one of another run does.

Source

pub fn lost(&self) -> Vec<(IfaceId, usize)>

Every followed collection read as a lost delivery (Views::is_lost), by interface, then in map order.

Source

pub fn observation( &self, key: &str, now: T, listened: Duration, complete: bool, ) -> Option<Observation>

key as a subscription’s observation at now (§2.5), as View::observation, complete only while its collection is read as no lost delivery on either key that confirms it (Views::is_lost). None for a key of no view held.

Trait Implementations§

Source§

impl<T: Clone> Clone for Views<T>

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<T: Debug> Debug for Views<T>

Source§

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

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

impl<T> Default for Views<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Forget for Views<T>

§

impl<T> Freeze for Views<T>
where *const LeafNode<IfaceId, View<T>> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(IfaceId, View<T>)>>: Freeze, *const LeafNode<Class, ClassKey> is !null: Freeze, PhantomData<Box<(Class, ClassKey)>>: Freeze,

§

impl<T> Move for Views<T>

§

impl<T> RefUnwindSafe for Views<T>
where T: RefUnwindSafe,

§

impl<T> Send for Views<T>
where NodeRef<Owned, IfaceId, View<T>, LeafOrInternal>: Send, BoxRaw<(IfaceId, View<T>)>: Send, NodeRef<Owned, Class, ClassKey, LeafOrInternal>: Send, BoxRaw<(Class, ClassKey)>: Send,

§

impl<T> Sync for Views<T>
where NodeRef<Owned, IfaceId, View<T>, LeafOrInternal>: Sync, BoxRaw<(IfaceId, View<T>)>: Sync, NodeRef<Owned, Class, ClassKey, LeafOrInternal>: Sync, BoxRaw<(Class, ClassKey)>: Sync,

§

impl<T> Unpin for Views<T>
where *const LeafNode<IfaceId, View<T>> is !null: Unpin, Box<(IfaceId, View<T>)>: Unpin, *const LeafNode<Class, ClassKey> is !null: Unpin, Box<(Class, ClassKey)>: Unpin,

§

impl<T> UnsafeUnpin for Views<T>
where *const LeafNode<IfaceId, View<T>> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(IfaceId, View<T>)>>: UnsafeUnpin, *const LeafNode<Class, ClassKey> is !null: UnsafeUnpin, PhantomData<Box<(Class, ClassKey)>>: UnsafeUnpin,

§

impl<T> UnwindSafe for Views<T>

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

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

fn as_node_mut(&mut self) -> &mut T

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> DynClone for T
where T: Clone,

Source§

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

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