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: ComposerImplementations§
Source§impl Live
impl Live
pub fn new() -> Self
Sourcepub fn lock(live: &Mutex<Self>) -> MutexGuard<'_, Self>
pub fn lock(live: &Mutex<Self>) -> MutexGuard<'_, Self>
A panicking task must not take the view’s live state with it.
pub fn snapshot(&self) -> LiveState
Sourcepub fn seen(&mut self, slot: &SessionSlot)
pub fn seen(&mut self, slot: &SessionSlot)
This view has shown slot, so nothing about it is unseen.
Sourcepub fn attach(
&mut self,
slot: &SessionSlot,
failed_at: Option<SystemTime>,
) -> bool
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).
Sourcepub fn detach(&mut self, slot: &SessionSlot)
pub fn detach(&mut self, slot: &SessionSlot)
One page on slot has gone. The seat is let go with the last of them.
Sourcepub fn is_attached(&self, slot: &SessionSlot) -> bool
pub fn is_attached(&self, slot: &SessionSlot) -> bool
Whether a page is holding slot.
Sourcepub fn composer_sent(&mut self, slot: &SessionSlot, words: &str)
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).
Sourcepub fn apply(&mut self, update: &SessionUpdate)
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§
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§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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