pub unsafe trait ValidCheck<P> {
    const ALWAYS_VALID: bool = false;

    fn is_valid(_input: P) -> bool { ... }
}
Expand description

Check whether the underlying bits are valid

The type implementing this trait checks if the value stored in a bit representation of type P is a valid representation of this type. The enums macro implements this type for all of the integer-byte-width types from this crate.

Safety

The ValidCheck::is_valid function must be correctly implemented or else other functions in this crate won’t work correctly. Implementation of this trait is preferably done by public macros in this crate, which will implement it correctly.

Provided Associated Constants

Set this to true if, at compile-time, we can tell that all bit representations which contain the appropriate number of bits are valid representations of this type

Provided Methods

Return whether or not the underlying bits of P are valid representation of this type

Implementations on Foreign Types

Implementors