logos.lang.num.nonzero

Module lang · package logos-lang

Types

structNonZero

struct NonZero

Wraps a value of type T with the invariant that it never equals zero (T::default()). Unlike Rust, Option<NonZero<T>> gets no niche optimization yet — layout equals plain T.

Implements: Copy Eq

Fields

val: T

The wrapped value; non-zero whenever constructed via new / new_unchecked.