Skip to main content

Live

Struct Live 

Source
pub struct Live {
    unseen: Unseen,
    attached: HashMap<SessionSlot, usize>,
    seen_failed: HashMap<SessionSlot, SystemTime>,
    composer: Composer,
}
Expand description

What the view has learned from the stream, which the first render and every later one both read.

Fields§

§unseen: Unseen§attached: HashMap<SessionSlot, usize>

The seats a page is open on, by how many connections are showing them: a turn finishing on one of those is a turn the reader watched.

§seen_failed: HashMap<SessionSlot, SystemTime>

When each seat was last shown, by any connection. A failure newer than the stamp is one the reader has not seen, which is what the rail’s failure mark reads (#1612): one Live is folded per server and shared by every connection, so showing a seat spends its mark for all of them.

§composer: Composer

Implementations§

Source§

impl Live

Source

pub fn new() -> Self

Source

pub fn lock(live: &Mutex<Self>) -> MutexGuard<'_, Self>

A panicking task must not take the view’s live state with it.

Source

pub fn snapshot(&self) -> LiveState

Source

pub fn seen(&mut self, slot: &SessionSlot)

This view has shown slot, so nothing about it is unseen.

Source

pub fn attach( &mut self, slot: &SessionSlot, failed_at: Option<SystemTime>, ) -> bool

A page is open on slot, which is a connection showing it, so a mark armed before the page opened goes with it. Counted, because two tabs on one seat are one seat still being shown.

Answers whether a mark was actually spent - the diamond this view was carrying, or a failure at failed_at still showing for it. A connection that holds the home is owed a fresh one exactly then: a re-encode with nothing to carry is 448 KB and 113-263 ms of server time for a home the client already has (measured 2026-10-09).

Source

pub fn detach(&mut self, slot: &SessionSlot)

One page on slot has gone. The seat is let go with the last of them.

Source

pub fn is_attached(&self, slot: &SessionSlot) -> bool

Whether a page is holding slot.

Source

pub fn composer_sent(&mut self, slot: &SessionSlot, words: &str)

A write sent the seat’s words down a path the update stream does not carry; the composer’s own rule decides whether they were its landed take’s (#2283).

Source

pub fn apply(&mut self, update: &SessionUpdate)

Fold one update in: the marks it moves, and the composer’s own record.

The classification is what keeps a busy turn from mattering here for every token of it: only the updates that can change what a row draws move a mark.

Trait Implementations§

Source§

impl Default for Live

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Live

§

impl RefUnwindSafe for Live

§

impl Send for Live

§

impl Sync for Live

§

impl Unpin for Live

§

impl UnsafeUnpin for Live

§

impl UnwindSafe for Live

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
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

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
§

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

§

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

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

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

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

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

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

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