Skip to main content

Sentinel

Trait Sentinel 

pub trait Sentinel: Copy + Eq {
    const NONE: Self;
}
Expand description

A type that reserves one value of its domain to mean None, so SentinelOption<Self> needs no discriminant word and stays size_of::<Self>().

Required Associated Constants§

const NONE: Self

The reserved value standing for None. Must be a value real data never takes (for u32 positions, guaranteed by input_exceeds_u32).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl Sentinel for u32

§

const NONE: Self = u32::MAX

Implementors§