pub enum PropertyValue {
Text(String),
Bool(bool),
Int(i64),
Uint(u64),
Float(f64),
Enum {
selected: usize,
options: Vec<String>,
},
Flags {
selected: Vec<usize>,
options: Vec<String>,
},
Color(Color),
Date(String),
Path(String),
Aggregate(Vec<PropertyValue>),
}Expand description
The portable property value set (capability group P1).
Variants§
Text(String)
Free-form single-line text.
Bool(bool)
Boolean state.
Int(i64)
Signed integer.
Uint(u64)
Unsigned integer.
Float(f64)
Floating-point number (must be finite).
Enum
One of a fixed option list; selected indexes options.
Fields
Flags
Any number of a fixed option list; selected holds sorted, unique
indices into options.
Fields
Color(Color)
RGB color (the shared Color type).
Date(String)
ISO-8601 date text (YYYY-MM-DD).
Path(String)
Filesystem path text.
Aggregate(Vec<PropertyValue>)
Editor-defined composite value, for example a range ([Int, Int]),
a point ([Float, Float]), or a rectangle.
Implementations§
Source§impl PropertyValue
impl PropertyValue
Sourcepub const fn kind_name(&self) -> &'static str
pub const fn kind_name(&self) -> &'static str
Stable lowercase kind identifier used by diagnostics and errors.
Sourcepub fn is_compatible(&self, editor: PropertyEditor) -> bool
pub fn is_compatible(&self, editor: PropertyEditor) -> bool
Whether this value can be edited by editor.
Incompatible pairs are rejected at insertion and mutation time; a model never accepts a value its editor cannot represent.
Sourcepub fn validate(&self) -> PropertyResult<()>
pub fn validate(&self) -> PropertyResult<()>
Checks the value’s own invariants (indices, sorting, emptiness,
finiteness). Runs on every insertion/mutation and from
PropertyModel::validate.