Skip to main content

Property

Trait Property 

Source
pub trait Property:
    Debug
    + Sync
    + Send {
    type Value
       where Self: Sized;

    // Required methods
    fn get_value(&self, value: &str) -> Option<Self::Value>
       where Self: Sized;
    fn get_possible_values(&self) -> Box<[Self::Value]>
       where Self: Sized;
    fn get_internal_index(&self, value: &Self::Value) -> usize
       where Self: Sized;
    fn value_from_index(&self, index: usize) -> Self::Value
       where Self: Sized;
    fn value_count(&self) -> usize;
    fn value_name_from_index(&self, index: usize) -> &str;
    fn get_possible_value_names(&self) -> Box<[&str]>;
    fn get_name(&self) -> &'static str;
    fn compare_value_names(&self, left: &str, right: &str) -> Option<Ordering>;
}

Required Associated Types§

Source

type Value where Self: Sized

Required Methods§

Source

fn get_value(&self, value: &str) -> Option<Self::Value>
where Self: Sized,

Source

fn get_possible_values(&self) -> Box<[Self::Value]>
where Self: Sized,

Source

fn get_internal_index(&self, value: &Self::Value) -> usize
where Self: Sized,

Source

fn value_from_index(&self, index: usize) -> Self::Value
where Self: Sized,

Source

fn value_count(&self) -> usize

Source

fn value_name_from_index(&self, index: usize) -> &str

Source

fn get_possible_value_names(&self) -> Box<[&str]>

Source

fn get_name(&self) -> &'static str

Source

fn compare_value_names(&self, left: &str, right: &str) -> Option<Ordering>

Parses and compares two serialized values using Vanilla’s Comparable order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§