[][src]Struct crossterm_cursor::sys::winapi::Handle

pub struct Handle { /* fields omitted */ }

This abstracts away some WinaApi calls to set and get some console handles.

Methods

impl Handle[src]

pub fn new(handle: HandleType) -> Result<Handle, Error>[src]

pub fn current_out_handle() -> Result<*mut c_void, Error>[src]

Get the handle of the active screen buffer. When using multiple screen buffers this will always point to the to the current screen output buffer.

On success this function returns the HANDLE to STD_OUTPUT_HANDLE.

This function uses CONOUT$ to create a file handle to the current output buffer.

Wraps the underlying function call: [CreateFileW] link: [https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilew]

pub fn current_in_handle() -> Result<*mut c_void, Error>[src]

Get the handle of the active input screen buffer. When using multiple screen buffers this will always point to the to the current screen input buffer.

On success this function returns the HANDLE to STD_INPUT_HANDLE.

This function uses CONIN$ to create a file handle to the current input buffer.

Wraps the underlying function call: [CreateFileW] link: [https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilew]

pub fn output_handle() -> Result<*mut c_void, Error>[src]

Get the handle of the output screen buffer.

On success this function returns the HANDLE to STD_OUTPUT_HANDLE.

Wraps the underlying function call: [GetStdHandle] whit argument STD_OUTPUT_HANDLE link: [https://docs.microsoft.com/en-us/windows/console/getstdhandle]

pub fn input_handle() -> Result<*mut c_void, Error>[src]

Get the handle of the input screen buffer.

On success this function returns the HANDLE to STD_INPUT_HANDLE.

Wraps the underlying function call: [GetStdHandle] whit argument STD_INPUT_HANDLE link: [https://docs.microsoft.com/en-us/windows/console/getstdhandle]

pub fn is_valid_handle(handle: &*mut c_void) -> bool[src]

Checks if the console handle is an invalid handle value.

This is done by checking if the passed HANDLE is equal to INVALID_HANDLE_VALUE

Methods from Deref<Target = *mut c_void>

Trait Implementations

impl Deref for Handle[src]

type Target = *mut c_void

The resulting type after dereferencing.

impl From<*mut c_void> for Handle[src]

impl From<Handle> for ScreenBuffer[src]

impl From<Handle> for Cursor[src]

Auto Trait Implementations

impl !Send for Handle

impl !Sync for Handle

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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