Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }
Expand description

Portable state owner. Transport adapters feed snapshots/deltas and drain events; host UI code only sees owned DTOs and opaque receipts.

Implementations§

Source§

impl Session

Source

pub fn new(options: SessionOptions) -> Self

Source

pub fn status(&self) -> SessionStatus

Source

pub fn revision(&self) -> StateRevision

Source

pub fn state(&self) -> Option<&TerminalState>

Source

pub fn install_snapshot( &mut self, snapshot: TerminalSnapshot, ) -> Result<(), CoreError>

Source

pub fn apply_delta(&mut self, delta: &TerminalDelta) -> Result<(), CoreError>

Source

pub fn acknowledge(&mut self, receipt: CommitReceipt) -> AcknowledgeResult

Source

pub fn acknowledge_raw(&mut self, receipt: u64) -> AcknowledgeResult

A binding-friendly acknowledgement entry point that keeps receipt construction inside the core.

Source

pub fn submit_input(&mut self, bytes: &[u8]) -> Result<InputId, CoreError>

Source

pub fn complete_input( &mut self, id: InputId, outcome: InputOutcome, ) -> Result<(), CoreError>

Source

pub fn complete_input_raw( &mut self, id: u64, outcome: InputOutcome, ) -> Result<(), CoreError>

A binding-friendly completion entry point for an input id emitted by the core.

Source

pub fn begin_recovery(&mut self) -> Result<(), CoreError>

Source

pub fn suspend(&mut self) -> Result<(), CoreError>

Source

pub fn close(&mut self)

Source

pub fn next_event(&mut self) -> Option<SessionEvent>

Source

pub fn drain_events(&mut self)

Source

pub fn pending_input_count(&self) -> usize

Trait Implementations§

Source§

impl Debug for Session

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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<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, 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, <T as TryFrom<U>>::Error>

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.