Browse the docs

silk.platform.windows.input.

Raw-byte reads from the Windows standard-input handle.

When to use#

OsStandardInput uses WindowsInput.read beneath the portable StandardInput service. Console reads use the active console input code page. Redirected files and pipes preserve bytes.

Import as WindowsInput with import silk.platform.windows.input { WindowsInput }.

Public declarations: 1.

WindowsInput#

silk
pub struct WindowsInput

Unbuffered standard-input reads. The process retains ownership of its pointer-width handle.

Implementation WindowsInput#

silk
impl WindowsInput

Associated function read#

silk
pub effect fn read(buffer: &mut [u8], count: &mut usize, error: &mut i32) -> bool

Reads once into the buffer and returns success, capturing a Win32 error on failure.

Details#

Empty buffers make no host call. Each other read resolves the current standard handle and requests at most 4,294,967,295 bytes. Successful zero-byte reads and broken pipes report zero bytes with no error, including ERROR_HANDLE_EOF. A message-pipe partial read reports its received prefix. The count is zero on failure, and error is zero for an invalid host count. The handle is never closed. Console bytes use the active input code page; no text decoding is performed.

Category: Windows platform.

Profiles: x86_64-pc-windows-msvc.

View the source of this page