[−][src]Struct crossterm_winapi::Handle
This abstracts away some WinaApi calls to set and get some console handles.
Methods
impl Handle
[src]
pub fn new(handle: HandleType) -> Result<Handle>
[src]
pub unsafe fn from_raw(handle: HANDLE) -> Self
[src]
Construct a handle from a raw handle.
Safety
This is unsafe since there is not guarantee that the underlying HANDLE is thread-safe to implement Send
and Sync
.
Most HANDLE's however, are thread safe.
pub fn current_out_handle() -> Result<Handle>
[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<Handle>
[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<Handle>
[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<Handle>
[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: &HANDLE) -> 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
Trait Implementations
impl Clone for Handle
[src]
impl Debug for Handle
[src]
impl Deref for Handle
[src]
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
impl From<Handle> for ConsoleMode
[src]
impl From<Handle> for ScreenBuffer
[src]
Auto Trait Implementations
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,