[−][src]Struct sunrise_libuser::terminal::Terminal
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SizedIPCBuffer for T
[src]
fn size(&Self) -> usize
[src]
fn is_cool(usize, usize) -> bool
[src]
unsafe fn from_raw_parts<'a>(usize, usize) -> &'a T
[src]
unsafe fn from_raw_parts_mut<'a>(usize, usize) -> &'a mut T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,