Struct dust_lib::VariableMap
source · pub struct VariableMap { /* private fields */ }Expand description
A collection dust variables comprised of key-value pairs.
The inner value is a BTreeMap in order to allow VariableMap instances to be sorted and compared to one another.
Implementations§
source§impl VariableMap
impl VariableMap
sourcepub fn call_function(&self, identifier: &str, argument: &Value) -> Result<Value>
pub fn call_function(&self, identifier: &str, argument: &Value) -> Result<Value>
Invokes built-in tools or user-defined functions based on the identifier and passes the
argument. Returns an error a tool is called with the wrong inputs or if the identifier does
not match any tools or functions.
sourcepub fn get_value(&self, identifier: &str) -> Result<Option<Value>>
pub fn get_value(&self, identifier: &str) -> Result<Option<Value>>
Returns a Value assigned to the identifer, allowing dot notation to retrieve Values that are /// nested in Lists or Maps. Returns None if there is no variable with a key matching the /// identifier. Returns an error if a Map or List is indexed incorrectly.
Trait Implementations§
source§impl Clone for VariableMap
impl Clone for VariableMap
source§fn clone(&self) -> VariableMap
fn clone(&self) -> VariableMap
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for VariableMap
impl Debug for VariableMap
source§impl Default for VariableMap
impl Default for VariableMap
source§impl<'de> Deserialize<'de> for VariableMap
impl<'de> Deserialize<'de> for VariableMap
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for VariableMap
impl Display for VariableMap
source§impl From<&Table> for VariableMap
impl From<&Table> for VariableMap
source§impl From<&VariableMap> for Table
impl From<&VariableMap> for Table
source§fn from(map: &VariableMap) -> Self
fn from(map: &VariableMap) -> Self
Converts to this type from the input type.
source§impl From<&mut VariableMap> for Table
impl From<&mut VariableMap> for Table
source§fn from(map: &mut VariableMap) -> Self
fn from(map: &mut VariableMap) -> Self
Converts to this type from the input type.
source§impl From<VariableMap> for Table
impl From<VariableMap> for Table
source§fn from(map: VariableMap) -> Self
fn from(map: VariableMap) -> Self
Converts to this type from the input type.
source§impl Ord for VariableMap
impl Ord for VariableMap
source§fn cmp(&self, other: &VariableMap) -> Ordering
fn cmp(&self, other: &VariableMap) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<VariableMap> for VariableMap
impl PartialEq<VariableMap> for VariableMap
source§fn eq(&self, other: &VariableMap) -> bool
fn eq(&self, other: &VariableMap) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<VariableMap> for VariableMap
impl PartialOrd<VariableMap> for VariableMap
source§fn partial_cmp(&self, other: &VariableMap) -> Option<Ordering>
fn partial_cmp(&self, other: &VariableMap) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for VariableMap
impl Serialize for VariableMap
impl Eq for VariableMap
impl StructuralEq for VariableMap
impl StructuralPartialEq for VariableMap
Auto Trait Implementations§
impl RefUnwindSafe for VariableMap
impl Send for VariableMap
impl Sync for VariableMap
impl Unpin for VariableMap
impl UnwindSafe for VariableMap
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.