pub struct TerminalEntry {
pub id: u16,
pub terminal: Arc<Terminal>,
pub last_used: Mutex<Instant>,
pub attached: AtomicUsize,
controller: AtomicU64,
control: Sender<Option<u64>>,
}Expand description
One seat’s terminal, as the registry holds it.
Fields§
§id: u16The id the binary frames carry.
terminal: Arc<Terminal>§last_used: Mutex<Instant>When an agent call or a viewer last touched it, for the idle clock.
attached: AtomicUsizeHow many clients are attached.
controller: AtomicU64The connection holding the person’s control, or 0 for the agent. One at a time, like the browser’s controller: another client can take it over, and the holder always hears it lost the role.
control: Sender<Option<u64>>The holder every attached viewer follows, so a bar can say who has it.
Implementations§
Source§impl TerminalEntry
impl TerminalEntry
fn touch(&self)
Sourcepub fn controller(&self) -> Option<u64>
pub fn controller(&self) -> Option<u64>
The person’s connection holding the terminal, when one does.
Sourcepub fn take_control(&self, viewer: u64)
pub fn take_control(&self, viewer: u64)
Give one connection the person’s control, telling every attached viewer who holds it. A take always lands: like the browser’s role, a second client taking over is how the first one loses it.
Sourcepub fn clear_control(&self)
pub fn clear_control(&self)
Give the person’s control back to the agent whatever connection holds it, which is what the end of a hand-off owes: the ask parked the keyboard, and the ending takes it back.
Sourcepub fn release_control(&self, viewer: u64) -> bool
pub fn release_control(&self, viewer: u64) -> bool
Give control back when its holder releases it; another connection’s release is not this one’s to take.
Sourcepub fn control_stream(&self) -> Receiver<Option<u64>>
pub fn control_stream(&self) -> Receiver<Option<u64>>
Follow the controller: the latest holder, and every change.
fn idle_for(&self) -> Duration
Sourcepub fn summary(&self, slot: &SessionSlot, held: bool) -> TerminalSummary
pub fn summary(&self, slot: &SessionSlot, held: bool) -> TerminalSummary
The summary the strip and the session record draw.
Auto Trait Implementations§
impl !Freeze for TerminalEntry
impl !RefUnwindSafe for TerminalEntry
impl !UnwindSafe for TerminalEntry
impl Send for TerminalEntry
impl Sync for TerminalEntry
impl Unpin for TerminalEntry
impl UnsafeUnpin for TerminalEntry
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