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, or back to it.

Functions

functionget: func() -> u64

The current count, now wide enough to never wrap.

functionincrement: func()

Adds one to the count.

functionreset: func()

Sets the count back to zero.

WIT

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

  /// Adds one to the count.
  increment: func();

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