pub struct Context<C: ColourConfig = DefaultColourConfig> { /* private fields */ }
Expand description
An interface to a terminal for rendering View
s, and getting input.
Implementations§
Source§impl<C: ColourConfig> Context<C>
impl<C: ColourConfig> Context<C>
pub fn with_colour_config(colour_config: C) -> Result<Self>
pub fn from_terminal_with_colour_config( terminal: Terminal, colour_config: C, ) -> Result<Self>
pub fn drain_input(&mut self) -> Result<Drain<'_, Input>>
Sourcepub fn poll_input(&mut self) -> Result<Option<Input>>
pub fn poll_input(&mut self) -> Result<Option<Input>>
Gets an input event from the terminal if one is present, returning immediately.
Sourcepub fn wait_input(&mut self) -> Result<Input>
pub fn wait_input(&mut self) -> Result<Input>
Gets an input event from the terminal, waiting until an event occurs.
Sourcepub fn wait_input_timeout(&mut self, timeout: Duration) -> Result<Option<Input>>
pub fn wait_input_timeout(&mut self, timeout: Duration) -> Result<Option<Input>>
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<()>
pub fn render_at<V: View<T>, T, R: ViewTransformRgb24>( &mut self, view: &mut V, data: T, context: ViewContext<R>, ) -> Result<()>
pub fn size(&self) -> Result<Size>
Auto Trait Implementations§
impl<C> Freeze for Context<C>where
C: Freeze,
impl<C> RefUnwindSafe for Context<C>where
C: RefUnwindSafe,
impl<C> Send for Context<C>where
C: Send,
impl<C> Sync for Context<C>where
C: Sync,
impl<C> Unpin for Context<C>where
C: Unpin,
impl<C> UnwindSafe for Context<C>where
C: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more