Trait cvar::IProperty[][src]

pub trait IProperty: INode {
    fn get(&self) -> String;
fn set(
        &mut self,
        val: &str
    ) -> Result<(), Box<dyn StdError + Send + Sync + 'static>>;
fn reset(&mut self);
fn default(&self) -> String;
fn state(&self) -> PropState; fn flags(&self) -> u32 { ... }
fn values(&self) -> Option<&[&str]> { ... } }

Property node interface.

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

Required methods

fn get(&self) -> String[src]

Gets the value as a string.

fn set(
    &mut self,
    val: &str
) -> Result<(), Box<dyn StdError + Send + Sync + 'static>>
[src]

Sets the value.

fn reset(&mut self)[src]

Resets the value to its default.

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

fn default(&self) -> String[src]

Gets the default value as a string.

fn state(&self) -> PropState[src]

Returns the state of the property.

Loading content...

Provided methods

fn flags(&self) -> u32[src]

Returns the flags associated with the property.

The meaning of this value is defined by the caller.

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

Returns a list of valid value strings for this property.

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

Loading content...

Trait Implementations

impl Debug for dyn IProperty + '_[src]

Implementors

impl<'a, T> IProperty for ClampedProp<'a, T> where
    T: FromStr + ToString + Clone + PartialEq + PartialOrd,
    T::Err: StdError + Send + Sync + 'static, 
[src]

impl<'a, T> IProperty for Property<'a, T> where
    T: FromStr + ToString + Clone + PartialEq,
    T::Err: StdError + Send + Sync + 'static, 
[src]

impl<'a, T: ToString + PartialEq> IProperty for ReadOnlyProp<'a, T>[src]

impl<T> IProperty for OwnedProp<T> where
    T: FromStr + ToString + Clone + PartialEq,
    T::Err: StdError + Send + Sync + 'static, 
[src]

Loading content...