Struct termit::Terminal

source ·
pub struct Terminal<C, I, O> {
    pub control: C,
    pub input: I,
    pub output: O,
}
Expand description

Your main gate to TUI to set up Termit.

let mut termit = Terminal::try_system_default()?.into_termit::<NoAppEvent>();

Terminal on it’s own doesn’t reset the terminal back to it’s initial state (raw mode, styles, captures…) Termit does that. We get a Termit instance by calling Terminal::into_termit(). Use that to build your app.

Fields§

§control: C§input: I§output: O

Implementations§

source§

impl<'a, C, I, O> Terminal<C, I, O>where C: Control + 'a, I: AsyncRead + 'a, O: Write + 'a,

source

pub fn into_termit<A: AppEvent>(self) -> Termit<'a, A>

source§

impl Terminal<NixTty, AsyncReader<Stdin>, Stdout>

source§

impl<C, I, O> Terminal<C, I, O>

source

pub fn new(control: C, input: I, output: O) -> Terminal<C, I, O>

source§

impl<C, I, O> Terminal<C, I, O>where O: Write,

source

pub fn controlling<C2>(self, control: C2) -> Terminal<C2, I, O>

Change the controlling tty. Mind you, this will reset raw mode on the previous one.

source

pub fn reading<I2>(self, input: I2) -> Terminal<C, I2, O>

source

pub fn writing<O2>(self, output: O2) -> Terminal<C, I, O2>where O2: Write,

Trait Implementations§

source§

impl Default for Terminal<NoIo, NoIo, NoIo>

source§

fn default() -> Self

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

impl<'a, C, I, O, A: AppEvent> From<Terminal<C, I, O>> for Termit<'a, A>where C: Control + 'a, I: AsyncRead + 'a, O: Write + 'a,

source§

fn from(terminal: Terminal<C, I, O>) -> Self

Converts to this type from the input type.
source§

impl<C, I, O> TerminalCommander for Terminal<C, I, O>where O: Write, C: Control,

source§

fn send<T: TerminalRequest>(&mut self, request: T) -> Result<()>

Auto Trait Implementations§

§

impl<C, I, O> RefUnwindSafe for Terminal<C, I, O>where C: RefUnwindSafe, I: RefUnwindSafe, O: RefUnwindSafe,

§

impl<C, I, O> Send for Terminal<C, I, O>where C: Send, I: Send, O: Send,

§

impl<C, I, O> Sync for Terminal<C, I, O>where C: Sync, I: Sync, O: Sync,

§

impl<C, I, O> Unpin for Terminal<C, I, O>where C: Unpin, I: Unpin, O: Unpin,

§

impl<C, I, O> UnwindSafe for Terminal<C, I, O>where C: UnwindSafe, I: UnwindSafe, O: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

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

§

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.