pub fn read_console_input_with<'i>(console_input: &mut impl AsConsoleInputHandle, buffer: &'i mut [INPUT_RECORD]) -> io::Result<&'i [INPUT_RECORD]> {
    let length : DWORD = buffer.len().try_into().unwrap_or(!0);
    let mut read = 0;
    succeeded_to_result(unsafe { ReadConsoleInputW(console_input.as_raw_handle().cast(), buffer.as_mut_ptr(), length, &mut read) })?;
    Ok(&buffer[.. read as _])
}
/// \[[ReadConsoleInput]\] Reads data from a console input buffer and removes it from the buffer.
///
/// ### Example
/// ```
/// # use maulingmonkey_console_winapi_wrappers::*;
/// # use std::io::{self, *};
/// # let _ = (|| -> io::Result<()> {
/// for record in read_console_input_with(&mut stdin(), &mut <[_; 8]>::default())? {
///     // ...
/// }
/// # Ok(())
/// # })();
/// ```
///
/// [ReadConsoleInput]: https://docs.microsoft.com/en-us/windows/console/readconsoleinput
\[[ReadConsoleInput]\] Reads data from a console input buffer and removes it from the buffer.
\ [[ ReadConsoleInput ] \ ] Reads data from a console input buffer and removes it from the buffer .
pub fn read_console_input_with<'i>(console_input: &mut impl AsConsoleInputHandle, buffer: &'i mut [INPUT_RECORD]) -> io::Result<&'i [INPUT_RECORD]> {
    let length : DWORD = buffer.len().try_into().unwrap_or(!0);
    let mut read = 0;
    succeeded_to_result(unsafe { ReadConsoleInputW(console_input.as_raw_handle().cast(), buffer.as_mut_ptr(), length, &mut read) })?;
    Ok(&buffer[.. read as _])
}
pub fn read_console_input_with < ' i > ( console_input : & mut impl AsConsoleInputHandle , buffer : & ' i mut [ INPUT_RECORD ] ) -> io :: Result < & ' i [ INPUT_RECORD ] > { let length : DWORD = buffer . len ( ) . try_into ( ) . unwrap_or ( ! 0 ) ; let mut read = 0 ; succeeded_to_result ( unsafe { ReadConsoleInputW ( console_input . as_raw_handle ( ) . cast ( ) , buffer . as_mut_ptr ( ) , length , & mut read ) } ) ? ; Ok ( & buffer [ .. read as _ ] ) }
\[[ReadConsoleInput]\] Reads data from a console input buffer and removes it from the buffer.
\ [[ ReadConsoleInput ] \ ] Reads data from a console input buffer and removes it from the buffer .
console_input
&mut impl AsConsoleInputHandle
buffer
&'i mut [INPUT_RECORD]
console_input
&mut impl AsConsoleInputHandle
buffer
&'i mut [INPUT_RECORD]
example
None
use maulingmonkey_console_winapi_wrappers::*;
None
use std::io::{self, *};
None
let _ = (|| -> io::result<()> {
for record in read_console_input_with(&mut stdin(), &mut <[_; 8]>::default()).
for record in read_console_input_with ( &mut stdin () &mut < [ _ ; 8 ] > :: default () ) .
ok(())
None
})();
None