Skip to content

Unit

1 min read

Import: import system.core;

Unit

The success value of an operation that has nothing to return. A fallible action returns Result<Unit, E>: Ok(Unit()) on success and Err(error) on failure, so ? and switch work the same as for any other Result.

public struct Unit

constructor

Creates the single Unit value.

public constructor()