componentized

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

A counter, counting up from zero by any amount, or back to it.

Functions

functionget: func() -> u64

The current count, now wide enough to never wrap.

functionreset: func()

Sets the count back to zero.

functionadd: func(n: u64)

Adds to the count.

WIT

/// A counter, counting up from zero by any amount, or back to it.
interface counter {
  /// The current count, now wide enough to never wrap.
  get: func() -> u64;

  /// Sets the count back to zero.
  reset: func();

  /// Adds to the count.
  add: func(n: u64);
}