.InvariantsCore
AbstractInvariant
abstract type
defined in module
InvariantsCore
abstract type AbstractInvariant
An
Invariant
checks if an input satisfies some invariant. For example, it may check whether a number is positive.
For most use cases, using
invariant
to create an invariant will suffice and implementing your own subtype of
AbstractInvariant
will rarely be necessary.
The interface of
Invariant
s is designed so that
the invariant can be checked, given some input
invariants can be composed to generate more complicated invariants
the creation of rich error messages is possible when an invariant is not satisfied.
An
Invariant
I
must implement the following methods:
title
(::I)::String
: Descriptive name for the invariant
description
(::I)::String
: A longer description of the invariant, giving explanation and pointing to related information.
satisfies
(::I, input) -> (nothing | msg)
: Check whether an
input
satisfies the invariant, returning either
nothing
on success or an error message.
The following pages link back here:
Invariants.jl , tree.jl , compose.jl , highlevel.jl , interface.jl , invariant.jl , wrapinvariant.jl