morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::FieldConstraint Struct Reference

The per-instance constraint declared for one field of an action. More...

#include <instance_constraints.hpp>

Public Attributes

std::string field
 Wire (JSON) key of the member this entry constrains.
std::optional< std::uint32_t > decimalPlaces {}
 The instance's decimal precision for this field. Overwrites x-decimalPlaces, and a submitted value that is not exactly representable at this many places is PrecisionExceeded.
std::optional< math::Rational > minimum {}
 Inclusive lower bound; emitted as x-minimum.
std::optional< math::Rational > maximum {}
 Inclusive upper bound; emitted as x-maximum.

Detailed Description

The per-instance constraint declared for one field of an action.

Every member other than field is optional and defaults to "not declared": an absent decimalPlaces leaves the compiled x-decimalPlaces alone, and an absent bound emits nothing and checks nothing. A constraint naming a field the action does not have is ignored (schema decoration never throws over an application's declaration mistake, exactly like formLayout).

Definition at line 114 of file instance_constraints.hpp.

Member Data Documentation

◆ field

std::string morph::forms::FieldConstraint::field

Wire (JSON) key of the member this entry constrains.

Definition at line 116 of file instance_constraints.hpp.

◆ decimalPlaces

std::optional<std::uint32_t> morph::forms::FieldConstraint::decimalPlaces {}

The instance's decimal precision for this field. Overwrites x-decimalPlaces, and a submitted value that is not exactly representable at this many places is PrecisionExceeded.

Definition at line 121 of file instance_constraints.hpp.

◆ minimum

std::optional<math::Rational> morph::forms::FieldConstraint::minimum {}

Inclusive lower bound; emitted as x-minimum.

Definition at line 124 of file instance_constraints.hpp.

◆ maximum

std::optional<math::Rational> morph::forms::FieldConstraint::maximum {}

Inclusive upper bound; emitted as x-maximum.

Definition at line 127 of file instance_constraints.hpp.


The documentation for this struct was generated from the following file: