Skip to main content

Store

Struct Store 

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

The records of one terminal. See the crate docs.

Implementations§

Source§

impl Store

Source

pub fn new() -> Self

A store with the spec’s full cap of 256 records.

Source

pub fn with_capacity(capacity: usize) -> Self

A store holding at most capacity records, clamped to 64..=256 (terminals MAY choose a lower limit but MUST support at least 64).

Source

pub fn set_drop_idle_on_lifetime_events(&mut self, on: bool)

Also drop idle records on process exit and new prompts (the spec allows either). Off by default.

Source

pub fn capacity(&self) -> usize

The record cap.

Source

pub fn len(&self) -> usize

Number of records.

Source

pub fn is_empty(&self) -> bool

Whether there are no records.

Source

pub fn get(&self, id: Option<&str>) -> Option<&Record>

The record for id (None is the root record).

Source

pub fn iter(&self) -> impl Iterator<Item = (Option<&str>, &Record)>

All records, ordered by id with the root first.

Source

pub fn effective_app(&self, id: Option<&str>) -> Option<&str>

The app of the record, or of its nearest ancestor record that has one. Ancestors do not need to exist. None if no record on the path carries an app.

Source

pub fn apply(&mut self, message: &Message<'_>) -> Vec<Change>

Applies one decoded message. Feature-detection messages change nothing.

Source

pub fn set(&mut self, report: &Report<'_>) -> Vec<Change>

Replaces the addressed record with report.

Source

pub fn clear(&mut self, id: Option<&str>) -> Vec<Change>

Removes the record id and every record beneath it, or every record when id is None.

Source

pub fn process_exited(&mut self) -> Vec<Change>

The process attached to the terminal exited: drops working and blocked records (and idle ones if so configured).

Source

pub fn prompt_started(&mut self) -> Vec<Change>

A new shell prompt began (OSC 133 A): same effect as process_exited.

Source

pub fn reset(&mut self) -> Vec<Change>

A full reset (RIS): removes every record. A soft reset (DECSTR) must not call this.

Trait Implementations§

Source§

impl Clone for Store

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Store

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Store

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Store

§

impl RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

§

impl UnwindSafe for Store

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.