IProperty

Trait IProperty 

Source
pub trait IProperty: INode {
    // Required methods
    fn get_value(&self) -> &dyn IValue;
    fn set_value(&mut self, val: &dyn IValue, writer: &mut dyn IWrite) -> bool;
    fn set(&mut self, val: &str, writer: &mut dyn IWrite) -> bool;
    fn reset(&mut self);
    fn default_value(&self) -> &dyn IValue;
    fn state(&self) -> PropState;

    // Provided methods
    fn flags(&self) -> u32 { ... }
    fn values(&self) -> Option<&[&str]> { ... }
}
Expand description

Property node interface.

Provides an object safe interface for properties, type erasing its implementation.

Required Methods§

Source

fn get_value(&self) -> &dyn IValue

Gets the value.

Source

fn set_value(&mut self, val: &dyn IValue, writer: &mut dyn IWrite) -> bool

Sets the value.

Source

fn set(&mut self, val: &str, writer: &mut dyn IWrite) -> bool

Sets the value parsed from string.

Source

fn reset(&mut self)

Resets the value to its default.

If this operation fails (for eg. read-only properties), it does so silently.

Source

fn default_value(&self) -> &dyn IValue

Gets the default value.

Source

fn state(&self) -> PropState

Returns the state of the property.

Provided Methods§

Source

fn flags(&self) -> u32

Returns the flags associated with the property.

The meaning of this value is defined by the caller.

Source

fn values(&self) -> Option<&[&str]>

Returns a list of valid value strings for this property.

None if the question is not relevant, eg. string or number nodes.

Trait Implementations§

Source§

impl Debug for dyn IProperty + '_

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§

Source§

impl<'a, 'x, T> IProperty for ClampedProp<'a, 'x, T>
where T: Clone + Default + PartialEq + PartialOrd + Display + FromStr, T::Err: StdError + Send + Sync + 'static,

Source§

impl<'a, 'x, T> IProperty for Property<'a, 'x, T>
where T: Clone + Default + PartialEq + Display + FromStr, T::Err: StdError + Send + Sync + 'static,

Source§

impl<'a, T: PartialEq + IValue> IProperty for ReadOnlyProp<'a, T>

Source§

impl<T> IProperty for OwnedProp<T>
where T: Clone + Default + PartialEq + Display + FromStr, T::Err: StdError + Send + Sync + 'static,