Altout

Struct Altout 

Source
pub struct Altout(/* private fields */);
Expand description

Corresponding to std::io::Stdout

Implementations§

Source§

impl Altout

Source

pub fn lock(&self) -> AltoutLock<'_>

Locks this handle to the altio output stream, returning a writable guard.

The lock is released when the returned lock goes out of scope. The returned guard also provide write_fmt() for writing data.

Source

pub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<()>

Writes a formatted string into Altout, won’t returning any error.

Source

pub fn flush(&mut self) -> Result<()>

No-op.

Source

pub fn is_terminal(&self) -> bool

Returns false to indicate it isn’t a terminal/tty.

Source§

impl Altout

Source

pub fn recv(&self) -> String

Receives text from altio output stream.

This function will always block the current thread if there is no data available.

Source

pub fn try_recv(&self) -> Option<String>

Tries to receive text from altio output stream, without blocking.

Source

pub fn recv_line(&self) -> String

Receives one line of text from altio output stream.

This function will always block the current thread if there is no data available.

Source

pub fn try_recv_line(&self) -> Option<String>

Tries to receive one line of text from altio output stream, without blocking.

Source

pub fn recv_lines(&self, cnt: usize) -> String

Receives certain amount lines of text from altio output stream.

This function will always block the current thread if there is no data available.

Source

pub fn try_recv_lines(&self, cnt: usize) -> Option<String>

Tries to receive certain amount lines of text from altio output stream.

Source

pub fn peek_line(&self) -> Option<String>

Read one line of text in altio output stream, leaving it in the stream.

This function will always block the current thread if there is no data available.

Source

pub fn peek_lines(&self, cnt: usize) -> Option<String>

Tries to receive certain amount lines of text in altio output stream, leaving it in the stream.

This function will always block the current thread if there is no data available.

Trait Implementations§

Source§

impl Debug for Altout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Altout

Source§

fn default() -> Altout

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

Auto Trait Implementations§

§

impl !Freeze for Altout

§

impl RefUnwindSafe for Altout

§

impl Send for Altout

§

impl Sync for Altout

§

impl Unpin for Altout

§

impl UnwindSafe for Altout

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Source§

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.