[][src]Struct sunrise_libuser::terminal::Terminal

pub struct Terminal {
    buffer: ArrayVec<[u8; 256]>,
    pipe: IPipeProxy,
}

A struct for logging text to the window.

Writes to the Terminal are buffered until either a \n is sent, or more than 256 bytes are written. To immediately draw a write, use [fn draw].

Reads are similarly buffered until a \n is received by vi.

Fields

buffer: ArrayVec<[u8; 256]>

Internal write buffer.

pipe: IPipeProxy

The vi pipe backing this terminal.

Implementations

impl Terminal[src]

pub fn new(size: WindowSize) -> Result<Terminal, Error>[src]

Creates a new Window of the requested size for terminal usage.

pub fn draw(&mut self) -> Result<(), Error>[src]

Flush the write buffer and draw the text.

pub fn clone_pipe(&self) -> Result<IPipeProxy, Error>[src]

Clone this terminal's pipe.

pub fn read(&mut self, data: &mut [u8]) -> Result<u64, Error>[src]

Read a line of text. Note that it might return without reading an entire line if the buffer is not big enough. The user should check if a \n is present in data.

Trait Implementations

impl Debug for Terminal[src]

impl Write for Terminal[src]

Auto Trait Implementations

impl RefUnwindSafe for Terminal

impl Send for Terminal

impl Sync for Terminal

impl Unpin for Terminal

impl UnwindSafe for Terminal

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> SizedIPCBuffer for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.