OxL Reference

data InvalidValue

A value violates the predicate of a refined type (§3.6).

Example:

oxl✓ checked in CI
type Percent = u8 where 0..=90

fn main() io {
  match Percent.from(95) {
    Percent p => print("{p}")
    InvalidValue _ => print("rejected")
  }
}
Output
rejected
@error pub(api) data InvalidValue

Since. 1.0.0-beta

Fields

pub(api) msg: str = ""

Which predicate was violated.

Defined in: std/core/types.oxl:1143

See also