[][src]Struct crossterm_winapi::Console

pub struct Console { /* fields omitted */ }

Could be used to do some basic things with the console.

Methods

impl Console[src]

pub fn output() -> Result<Console>[src]

Create new instance of Console.

This created instance will use the default output handle (STD_OUTPUT_HANDLE) as handle for the function call it wraps.

pub fn set_text_attribute(&self, value: u16) -> Result<()>[src]

Sets the attributes of characters written to the console screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function. This function affects text written after the function call.

parameter: [wAttributes] Wraps the underlying function call: SetConsoleTextAttribute link: [https://docs.microsoft.com/en-us/windows/console/setconsoletextattribute]

pub fn set_console_info(
    &self,
    absolute: bool,
    rect: WindowPositions
) -> Result<()>
[src]

Sets the current size and position of a console screen buffer's window.

Wraps the underlying function call: SetConsoleTextAttribute link: [https://docs.microsoft.com/en-us/windows/console/setconsoletextattribute]

pub fn fill_whit_character(
    &self,
    start_location: Coord,
    cells_to_write: u32,
    filling_char: char
) -> Result<u32>
[src]

Writes a character to the console screen buffer a specified number of times, beginning at the specified coordinates

Wraps the underlying function call: FillConsoleOutputCharacterA link: [https://docs.microsoft.com/en-us/windows/console/fillconsoleoutputcharacter]

pub fn fill_whit_attribute(
    &self,
    start_location: Coord,
    cells_to_write: u32,
    dw_attribute: u16
) -> Result<u32>
[src]

Sets the character attributes for a specified number of character cells, beginning at the specified coordinates in a screen buffer.

Wraps the underlying function call: FillConsoleOutputAttribute link: [https://docs.microsoft.com/en-us/windows/console/fillconsoleoutputattribute]

pub fn largest_window_size(&self) -> Coord[src]

Retrieves the size of the largest possible console window, based on the current text and the size of the display.

Wraps the underlying function call: GetLargestConsoleWindowSize link: [https://docs.microsoft.com/en-us/windows/console/getlargestconsolewindowsize]

pub fn write_char_buffer(&self, buf: &[u8]) -> Result<usize>[src]

Writes a character string to a console screen buffer beginning at the current cursor location.

Wraps the underlying function call: WriteConsoleW link: [https://docs.microsoft.com/en-us/windows/console/writeconsole]

pub fn read_single_input_event(&self) -> Result<InputRecord>[src]

pub fn read_console_input(&self) -> Result<(u32, Vec<InputRecord>)>[src]

pub fn number_of_console_input_events(&self) -> Result<u32>[src]

Trait Implementations

impl From<Handle> for Console[src]

fn from(handle: Handle) -> Self[src]

Create a Console instance who's functions will be executed on the the given Handle

Auto Trait Implementations

impl Send for Console

impl Sync for Console

impl Unpin for Console

impl UnwindSafe for Console

impl RefUnwindSafe for Console

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]