Module spin_sdk.wit.imports.wasi_cli_stdin_0_3_0

Functions

def read_via_stream() ‑> Tuple[componentize_py_async_support.streams.ByteStreamReader, componentize_py_async_support.futures.FutureReader[componentize_py_types.Ok[None] | componentize_py_types.Err[ErrorCode]]]
Expand source code
def read_via_stream() -> Tuple[ByteStreamReader, FutureReader[Result[None, wasi_cli_types_0_3_0.ErrorCode]]]:
    """
    Return a stream for reading from stdin.
    
    This function returns a stream which provides data read from stdin,
    and a future to signal read results.
    
    If the stream's readable end is dropped the future will resolve to success.
    
    If the stream's writable end is dropped the future will either resolve to
    success if stdin was closed by the writer or to an error-code if reading
    failed for some other reason.
    
    Multiple streams may be active at the same time. The behavior of concurrent
    reads is implementation-specific.
    """
    raise NotImplementedError

Return a stream for reading from stdin.

This function returns a stream which provides data read from stdin, and a future to signal read results.

If the stream's readable end is dropped the future will resolve to success.

If the stream's writable end is dropped the future will either resolve to success if stdin was closed by the writer or to an error-code if reading failed for some other reason.

Multiple streams may be active at the same time. The behavior of concurrent reads is implementation-specific.