ensure

Provides functionality for validating function arguments.

Members

Classes

EnsureException
class EnsureException

Thrown for any validation errors.

Enums

isNullable
eponymoustemplate isNullable(T)

Tests if a type can be null. Not related to std.typecons.Nullable!T.

nameof
eponymoustemplate nameof(alias symbol)

A convenience wrapper for __traits( identifier, ... ).

Functions

between
Arg!N between(Arg!N arg, N lowerBound, N upperBound)

Ensures that a number is between an upper bound and a lower bound.

ensure
Arg!(typeof(what)) ensure()

Wrap a function argument to perform validation.

isNotEmpty
Arg!T isNotEmpty(Arg!T arg)

Ensures that an array, associative array, string, or input range is not empty.

isNotNull
Arg!T isNotNull(Arg!T arg)

Ensures that the argument is not null.

isNotNull
Arg!T isNotNull(Arg!T arg)

Ensures that the std.typecons.Nullable is not in a null state.

isNotNull
Arg!T isNotNull(Arg!T arg)

Ensures that the std.typecons.NullableRef is not in a null state.

isNotWhitespace
Arg!S isNotWhitespace(Arg!S arg)

Ensures that a string does not contain only whitespace characters.

Structs

Arg
struct Arg(T)

Represents a single function parameter, including name and value, upon which all validation is performed.

Meta

Authors

Tony J. Hudgins