pub fn read_console<'i>(console_input: &mut impl AsConsoleInputHandle, buffer: &'i mut [u16], input_control: Option<&CONSOLE_READCONSOLE_CONTROL>) -> io::Result<&'i [u16]> {
    let input_control : *const CONSOLE_READCONSOLE_CONTROL = match input_control {
        None => null(),
        Some(ctrl) => ctrl,
    };
    let length : DWORD = buffer.len().try_into().unwrap_or(!0);
    let mut read = 0;
    succeeded_to_result(unsafe { ReadConsoleW(console_input.as_raw_handle().cast(), buffer.as_mut_ptr().cast(), length, &mut read, input_control as *mut _) })?;
    Ok(&buffer[.. read as _])
}
/// \[[ReadConsole]\] Reads character input from the console input buffer and removes it from the buffer.
///
/// ### Example
/// ```
/// # use maulingmonkey_console_winapi_wrappers::*;
/// # use std::io::{self, *};
/// # let _ = (|| -> io::Result<()> {
/// let mut buffer = [0u16; 1024];
/// let input : &[u16] = read_console(&mut stdin(), &mut buffer, None)?;
/// # Ok(())
/// # })();
/// ```
///
/// [ReadConsole]:  https://docs.microsoft.com/en-us/windows/console/readconsole
\[[ReadConsole]\] Reads character input from the console input buffer and removes it from the buffer.
\ [[ ReadConsole ] \ ] Reads character input from the console input buffer and removes it from the buffer .
pub fn read_console<'i>(console_input: &mut impl AsConsoleInputHandle, buffer: &'i mut [u16], input_control: Option<&CONSOLE_READCONSOLE_CONTROL>) -> io::Result<&'i [u16]> {
    let input_control : *const CONSOLE_READCONSOLE_CONTROL = match input_control {
        None => null(),
        Some(ctrl) => ctrl,
    };
    let length : DWORD = buffer.len().try_into().unwrap_or(!0);
    let mut read = 0;
    succeeded_to_result(unsafe { ReadConsoleW(console_input.as_raw_handle().cast(), buffer.as_mut_ptr().cast(), length, &mut read, input_control as *mut _) })?;
    Ok(&buffer[.. read as _])
}
pub fn read_console < ' i > ( console_input : & mut impl AsConsoleInputHandle , buffer : & ' i mut [ u16 ] , input_control : Option < & CONSOLE_READCONSOLE_CONTROL > ) -> io :: Result < & ' i [ u16 ] > { let input_control : * const CONSOLE_READCONSOLE_CONTROL = match input_control { None => null ( ) , Some ( ctrl ) => ctrl , } ; let length : DWORD = buffer . len ( ) . try_into ( ) . unwrap_or ( ! 0 ) ; let mut read = 0 ; succeeded_to_result ( unsafe { ReadConsoleW ( console_input . as_raw_handle ( ) . cast ( ) , buffer . as_mut_ptr ( ) . cast ( ) , length , & mut read , input_control as * mut _ ) } ) ? ; Ok ( & buffer [ .. read as _ ] ) }
\[[ReadConsole]\] Reads character input from the console input buffer and removes it from the buffer.
\ [[ ReadConsole ] \ ] Reads character input from the console input buffer and removes it from the buffer .
console_input
&mut impl AsConsoleInputHandle
buffer
&'i mut [u16]
input_control
Option<&CONSOLE_READCONSOLE_CONTROL>
console_input
&mut impl AsConsoleInputHandle
buffer
&'i mut [u16]
input_control
Option<&CONSOLE_READCONSOLE_CONTROL>
example
None
use maulingmonkey_console_winapi_wrappers::*;
None
use std::io::{self, *};
None
let _ = (|| -> io::result<()> {
None
ok(())
None
})();
None