componentized/directory

wasi:cli

interface dependency

WASI CLI interfaces for command-line programs

interface stdout wasi:cli/stdout@0.3.0 since 0.3.0

Types

use enum error-code

from wasi:cli/types@0.3.0

  • io

    Input/output error

  • illegal-byte-sequence

    Invalid or incomplete multibyte or wide character

  • pipe

    Broken pipe

Functions

functionwrite-via-stream: func( data: stream<u8>, ) -> future<result<_, error-code>>since 0.3.0

Write the given stream to stdout.

If the stream's writable end is dropped this function will either return success once the entire contents of the stream have been written or an error-code representing a failure.

Otherwise if there is an error the readable end of the stream will be dropped and this function will return an error-code.

WIT

@since(version = 0.3.0)
interface stdout {
  use types.{error-code};

  /// Write the given stream to stdout.
  ///
  /// If the stream's writable end is dropped this function will either return
  /// success once the entire contents of the stream have been written or an
  /// error-code representing a failure.
  ///
  /// Otherwise if there is an error the readable end of the stream will be
  /// dropped and this function will return an error-code.
  @since(version = 0.3.0)
  write-via-stream: func(data: stream<u8>) -> future<result<_, error-code>>;
}