Trait stepflow_data::var::Var[][src]

pub trait Var: Debug + AsAny {
    fn id(&self) -> &VarId;
fn value_from_str(&self, s: &str) -> Result<Box<dyn Value>, InvalidValue>;
fn validate_val_type(
        &self,
        val: &Box<dyn Value>
    ) -> Result<(), InvalidValue>; }

Required methods

fn id(&self) -> &VarId[src]

fn value_from_str(&self, s: &str) -> Result<Box<dyn Value>, InvalidValue>[src]

fn validate_val_type(&self, val: &Box<dyn Value>) -> Result<(), InvalidValue>[src]

Loading content...

Implementations

impl dyn Var + Send + Sync[src]

pub fn downcast<T>(&self) -> Option<&T> where
    T: Var + Any
[src]

pub fn is<T>(&self) -> bool where
    T: Var + Any
[src]

Implementors

impl Var for BoolVar[src]

fn id(&self) -> &VarId[src]

Gets the ID

fn value_from_str(&self, s: &str) -> Result<Box<dyn Value>, InvalidValue>[src]

Convert a &str to this Var’s corresponding value

fn validate_val_type(&self, val: &Box<dyn Value>) -> Result<(), InvalidValue>[src]

Validate the value type corresponds to this Var

impl Var for EmailVar[src]

fn id(&self) -> &VarId[src]

Gets the ID

fn value_from_str(&self, s: &str) -> Result<Box<dyn Value>, InvalidValue>[src]

Convert a &str to this Var’s corresponding value

fn validate_val_type(&self, val: &Box<dyn Value>) -> Result<(), InvalidValue>[src]

Validate the value type corresponds to this Var

impl Var for StringVar[src]

fn id(&self) -> &VarId[src]

Gets the ID

fn value_from_str(&self, s: &str) -> Result<Box<dyn Value>, InvalidValue>[src]

Convert a &str to this Var’s corresponding value

fn validate_val_type(&self, val: &Box<dyn Value>) -> Result<(), InvalidValue>[src]

Validate the value type corresponds to this Var

impl Var for TrueVar[src]

fn id(&self) -> &VarId[src]

Gets the ID

fn value_from_str(&self, s: &str) -> Result<Box<dyn Value>, InvalidValue>[src]

Convert a &str to this Var’s corresponding value

fn validate_val_type(&self, val: &Box<dyn Value>) -> Result<(), InvalidValue>[src]

Validate the value type corresponds to this Var

Loading content...