Table of Contents

Struct Unit

Namespace
Trellis
Assembly
Trellis.Core.dll

Sentinel type representing the absence of a meaningful value. Used as the type parameter for no-payload results: Result<Unit> represents an operation that either succeeds without producing a value or fails with an Error.

public readonly record struct Unit : IEquatable<Unit>
Implements
Inherited Members
Extension Methods

Remarks

Trellis v3 (per ADR-005) collapsed the non-generic Result instance type into the static factory class Result; the no-payload outcome shape is uniformly Result<Unit>.

Use Default (or its alias Value) when an explicit Unit instance is needed. Ok() returns Result<Unit> directly without requiring callers to mention Unit at all.

Properties

Default

The single canonical Unit value.

public static Unit Default { get; }

Property Value

Unit

Value

Alias for Default.

public static Unit Value { get; }

Property Value

Unit

See Also

Result
Result<TValue>