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>
impl<T: Arrival> Views<T>
Sourcepub fn insert(&mut self, view: View<T>) -> Option<View<T>>
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.
Sourcepub fn view_mut(&mut self, iface: &IfaceId) -> Option<&mut View<T>>
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.
Sourcepub fn view_of(&self, key: &str) -> Option<&View<T>>
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.
Sourcepub fn view_of_mut(&mut self, key: &str) -> Option<&mut View<T>>
pub fn view_of_mut(&mut self, key: &str) -> Option<&mut View<T>>
As Views::view_of, to change it.
Sourcepub fn classes(&self) -> Vec<Class>
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”).
Sourcepub fn class_horizon(&self, class: Class) -> Option<Duration>
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.
Sourcepub fn apply_owner(
&mut self,
class: Class,
tag: Tag,
stamp: Stamp,
body: &[u8],
through: Catalogs<'_>,
at: T,
) -> OwnerApplied
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.
- Refused: core §7.5 refuses it whole.
- Older: within one run, its seq is not after the last read one’s on this key.
- 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.
Sourcepub fn gap(&self, class: Class) -> Option<bool>
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.
Sourcepub fn last(&self, class: Class) -> Option<Stamp>
pub fn last(&self, class: Class) -> Option<Stamp>
The last owner heartbeat read on the key of class: its stamp.
Sourcepub fn owner_heartbeats(&self, class: Class) -> u64
pub fn owner_heartbeats(&self, class: Class) -> u64
How many owner heartbeats were read on the key of class, whatever
became of their groups.
Sourcepub fn is_lost(&self, iface: &IfaceId, index: usize) -> bool
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.
Sourcepub fn lost(&self) -> Vec<(IfaceId, usize)>
pub fn lost(&self) -> Vec<(IfaceId, usize)>
Every followed collection read as a lost delivery
(Views::is_lost), by interface, then in map order.
Sourcepub fn observation(
&self,
key: &str,
now: T,
listened: Duration,
complete: bool,
) -> Option<Observation>
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§
Auto Trait Implementations§
impl<T> Forget for Views<T>
impl<T> Freeze for Views<T>
impl<T> Move for Views<T>
impl<T> RefUnwindSafe for Views<T>where
T: RefUnwindSafe,
impl<T> Send for Views<T>
impl<T> Sync for Views<T>
impl<T> Unpin for Views<T>
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> 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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