[][src]Struct prototty_unix::Context

pub struct Context<C: ColourConfig = DefaultColourConfig> { /* fields omitted */ }

An interface to a terminal for rendering Views, and getting input.

Methods

impl Context<DefaultColourConfig>[src]

pub fn new() -> Result<Self>[src]

Initialise a new context using the current terminal.

pub fn from_terminal(terminal: Terminal) -> Result<Self>[src]

impl<C: ColourConfig> Context<C>[src]

pub fn with_colour_config(colour_config: C) -> Result<Self>[src]

pub fn from_terminal_with_colour_config(
    terminal: Terminal,
    colour_config: C
) -> Result<Self>
[src]

pub fn drain_input(&mut self) -> Result<Drain<'a, Input>>[src]

pub fn poll_input(&mut self) -> Result<Option<Input>>[src]

Gets an input event from the terminal if one is present, returning immediately.

pub fn wait_input(&mut self) -> Result<Input>[src]

Gets an input event from the terminal, waiting until an event occurs.

pub fn wait_input_timeout(&mut self, timeout: Duration) -> Result<Option<Input>>[src]

Gets an input event from the terminal, waiting until either an event occurs, or the timeout expires, in which case this method returns None.

pub fn render<V: View<T>, T>(&mut self, view: &mut V, data: T) -> Result<()>[src]

pub fn render_at<V: View<T>, T, R: ViewTransformRgb24>(
    &mut self,
    view: &mut V,
    data: T,
    context: ViewContext<R>
) -> Result<()>
[src]

pub fn size(&self) -> Result<Size>[src]

Auto Trait Implementations

impl<C> Send for Context<C> where
    C: Send

impl<C> Sync for Context<C> where
    C: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.