Enum ai_kit::datum::Datum
[−]
[src]
pub enum Datum {
Nil,
String(String),
Int(i64),
Float(f64),
Variable(String),
Vector(Vec<Datum>),
}Variants
NilString(String)Int(i64)Float(f64)Variable(String)Vector(Vec<Datum>)Methods
impl Datum[src]
fn to_string(&self) -> Option<String>
fn to_int(&self) -> Option<i64>
fn to_float(&self) -> Option<f64>
fn to_variable(&self) -> Option<String>
fn pprint(&self) -> String
Trait Implementations
impl Clone for Datum[src]
fn clone(&self) -> Datum
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Debug for Datum[src]
impl PartialOrd for Datum[src]
fn partial_cmp(&self, __arg_0: &Datum) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &Datum) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &Datum) -> bool
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, __arg_0: &Datum) -> bool
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &Datum) -> bool
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Default for Datum[src]
impl PartialEq for Datum[src]
fn eq(&self, other: &Datum) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl Eq for Datum[src]
impl Ord for Datum[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering between self and other. Read more
impl BindingsValue for Datum[src]
fn variable(s: &String) -> Option<Self>
Construct a BindingsValue variable using the specified string as it's name
fn to_variable(&self) -> Option<String>
Extract the name of this BindingsValue variable (if it is a variable)
impl ConstraintValue for Datum[src]
fn to_float(&self) -> Option<f64>
Attempt to convert this value to a float
fn float(c: f64) -> Self
Construct a ConstraintValue from a float
impl Unify<Datum> for Datum[src]
fn unify(
&self,
other: &Datum,
bindings: &Bindings<Self>
) -> Option<Bindings<Self>>
&self,
other: &Datum,
bindings: &Bindings<Self>
) -> Option<Bindings<Self>>
Check if this structure can be unified with another of the same type.
fn apply_bindings(&self, bindings: &Bindings<Self>) -> Option<Self>
Given some bindings, construct a new instance with any variables replaced by their values
fn variables(&self) -> Vec<String>
Return all variables in this tructure
fn rename_variables(&self, renamed_variables: &HashMap<String, String>) -> Self
Rename any variables in this structure with another variable name
fn nil() -> Self
Return a 'nil' sentinel value unique to this type of structure