FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MinValueValidationRule

    struct · ferroui-xaml-interactions-custom · v0.5.0

    struct MinValueValidationRule
    

    Validation rule that checks that a value is greater than or equal to a minimum value.

    Deviation (DEVIATIONS.md, Behaviors): the reference class is generic over the type T of the value (MinValueValidationRule<T>, created in markup with x:TypeArguments); classes of the class model are not generic, so the minimum is an untyped value, compared with the validated value by the ordering of untyped values (ValueTypes::compare, which converts the minimum to the type of the value: a minimum given as text in markup compares as a number with a number). An unset minimum is null (the reference's default of a value type T is its zero), and values that do not compare are not valid (the comparer of the reference throws).

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<MinValueValidationRule>
    

    Returns a strong reference to this object.

    Source

    min_value_property

    fn min_value_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Identifies the MinValue property.

    Source

    error_message_property

    fn error_message_property() -> &'static StyledProperty<Option<String>>
    

    Identifies the ErrorMessage property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a rule.

    Source

    min_value

    fn min_value(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the minimum value. This is a property of the object model.

    Source

    set_min_value

    fn set_min_value(self: &Self, value: Option<BoxedValue>)
    

    Source

    error_message

    fn error_message(self: &Self) -> Option<String>
    

    Gets or sets the error message for failed validation. This is a property of the object model.

    Source

    set_error_message

    fn set_error_message(self: &Self, value: Option<String>)
    

    Source

    validate

    fn validate(self: &Self, value: Option<&BoxedValue>) -> bool
    

    Validates the specified value: valid when it is not null and not below the minimum.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.