Trait zebra_chain::amount::Constraint

source ·
pub trait Constraint {
    // Required method
    fn valid_range() -> RangeInclusive<i64>;

    // Provided method
    fn validate(value: i64) -> Result<i64, Error> { ... }
}
Expand description

A trait for defining constraints on Amount

Required Methods§

source

fn valid_range() -> RangeInclusive<i64>

Returns the range of values that are valid under this constraint

Provided Methods§

source

fn validate(value: i64) -> Result<i64, Error>

Check if an input value is within the valid range

Object Safety§

This trait is not object safe.

Implementors§