@ts-rust/std - v0.0.5
    Preparing search index...

    Function none

    • Creates a None variant of an Option, representing the absence of a value.

      Produces an option indicating no value is present.

      Type Parameters

      • T

        The type of the absent value.

      Returns Option<T>

      An Option representing None.

      const x = none<number>();

      expect(x.isNone()).toBe(true);
      expect(() => x.expect("x is `None`")).toThrow("x is `None`");