[−][src]Trait crossterm::ExecutableCommand
A trait that defines behaviour for a command that will be executed immediately.
Required methods
fn execute(&mut self, command: impl Command<AnsiType = T>) -> Result<&mut Self>
Execute the given command directly.
Implementors
impl<T, A> ExecutableCommand<A> for T where
A: Display,
T: Write,
[src]
A: Display,
T: Write,
fn execute(&mut self, command: impl Command<AnsiType = A>) -> Result<&mut Self>
[src]
Execute the given command directly.
This function will write
the ANSI escape code to this type and call flush
.
In case you have many executions after on and another you can use queue(command)
to get some better performance.
The queue
function will not call flush
.
Remarks
- In the case of UNIX and windows 10, ANSI codes are written to the given 'writer'.
- In case of Windows versions lower than 10, a direct WinApi call will be made.
This is happening because Windows versions lower then 10 do not support ANSI codes, and thus they can't be written to the given buffer.
Because of that there is no difference between
execute
andqueue
for those windows versions.