componentized/directory

Synthetic sample. This package shows how the directory renders each WIT feature. It isn't published to any registry.

The generic types, alone and nested.

Types

use type a-u8

from kitchen-sink:types/primitives@0.1.0

  • u8

use type text

from kitchen-sink:types/primitives@0.1.0

  • string

type bytes

type rgba

  • list<u8, 4>

type pair

type maybe

type lookup

  • map<string, list<u32>>

type nested

  • option<list<tuple<string, option<u64>>>>

type no-payload

  • result

type ok-only

  • result<u32>

type err-only

type ok-and-err

WIT

/// The generic types, alone and nested.
interface containers {
  use primitives.{a-u8, a-string as text};

  type bytes = list<a-u8>;

  type rgba = list<u8, 4>;

  type pair = tuple<u32, text>;

  type maybe = option<text>;

  type lookup = map<string, list<u32>>;

  type nested = option<list<tuple<string, option<u64>>>>;

  type no-payload = result;

  type ok-only = result<u32>;

  type err-only = result<_, text>;

  type ok-and-err = result<bytes, text>;
}