Skip to content

std/unit

The Unit type — “no meaningful value.”

Unit is the return type of side-effecting operations (IO.print, Timer.sleep, Iter.each) and the value produced by a bare break. There is exactly one Unit value and it carries no information, so there is nothing to construct or inspect — a function returning Unit is called for its effect.

Import with import std/unit.

Types

type Unit

No meaningful value. Returned by side-effecting functions such as IO.print; produced by bare break.

impl Debug

fn inspect(value: Unit): String

impl Debug.inspect