[−][src]Trait crossterm_terminal::ExecutableCommand
A trait that defines behaviour for a command that will be executed immediately.
Required methods
fn execute<impl Command>(
self,
command: impl Command
) -> Self where
impl Command: Command<AnsiType = T>,
self,
command: impl Command
) -> Self where
impl Command
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<impl Command>(
self,
command: impl Command
) -> T where
impl Command: Command<AnsiType = A>,
[src]
self,
command: impl Command
) -> T where
impl Command
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
.
Check the command API for more information and all available commands.
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.