Skip to main content

ferroui_base/data/model/
i_notify_data_error_info.rs

1use super::Event;
2use crate::BoxedValue;
3
4/// Lets a model object report validation errors for its properties
5/// (synchronously or asynchronously).
6pub trait INotifyDataErrorInfo {
7    /// Whether the object has validation errors.
8    fn has_errors(&self) -> bool;
9
10    /// The validation errors of the property named `property_name`, or the
11    /// object-level errors when it is `None` or empty. Errors are untyped:
12    /// strings and boxed [`BindingError`](crate::data::BindingError) values
13    /// are shown as they are.
14    fn get_errors(&self, property_name: Option<&str>) -> Vec<BoxedValue>;
15
16    /// The event raised when the validation errors of a property (the event
17    /// argument; empty for the whole object) have changed.
18    fn errors_changed(&self) -> &Event<str>;
19}