Skip to main content

Queueable

Trait Queueable 

Source
pub trait Queueable: AsyncWrite {
    // Required methods
    fn queue(
        &mut self,
        command: impl Command,
    ) -> Result<CommandQueue<&mut Self>, Error>;
    fn queue_many(
        &mut self,
        command: impl Commands,
    ) -> Result<CommandQueue<&mut Self>, Error>;
}
Available on crate feature term only.
Expand description

Starts an asynchronous command queue for a writer.

Required Methods§

Source

fn queue( &mut self, command: impl Command, ) -> Result<CommandQueue<&mut Self>, Error>

Creates a queue that borrows this writer and adds command to it.

No bytes are written until CommandQueue::flush is awaited.

Source

fn queue_many( &mut self, command: impl Commands, ) -> Result<CommandQueue<&mut Self>, Error>

Adds an ordered batch of commands without writing to the underlying writer.

If any command cannot render its ANSI representation, this method removes every byte added by this call. Commands that were already queued remain intact.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<W> Queueable for W
where W: AsyncWrite + ?Sized,