Primitive

Trait Primitive 

Source
pub trait Primitive:
    Send
    + Serialize
    + Deserialize {
Show 19 methods // Required methods fn is_eq(&self, other: &dyn Primitive) -> bool; fn is_cmp(&self, other: &dyn Primitive) -> Option<Ordering>; fn do_add( &self, other: &dyn Primitive, ) -> Result<Box<dyn Primitive>, String>; fn do_sub( &self, other: &dyn Primitive, ) -> Result<Box<dyn Primitive>, String>; fn do_div( &self, other: &dyn Primitive, ) -> Result<Box<dyn Primitive>, String>; fn do_mul( &self, other: &dyn Primitive, ) -> Result<Box<dyn Primitive>, String>; fn do_rem( &self, other: &dyn Primitive, ) -> Result<Box<dyn Primitive>, String>; fn as_debug(&self) -> &dyn Debug; fn as_any(&self) -> &dyn Any; fn get_type(&self) -> PrimitiveType; fn as_box_clone(&self) -> Box<dyn Primitive>; fn to_json(&self) -> Value; fn format_mem(&self, content_type: &str, first: bool) -> Value; fn to_string(&self) -> String; fn as_bool(&self) -> bool; fn get_value(&self) -> &dyn Any; fn get_mut_value(&mut self) -> &mut dyn Any; fn to_msg(&self, content_type: String) -> Message; fn do_exec( &mut self, name: &str, args: &HashMap<String, Literal>, mem_type: &MemoryType, additional_info: &Option<HashMap<String, Literal>>, interval: Interval, content_type: &ContentType, data: &mut Data<'_>, msg_data: &mut MessageData, sender: &Option<Sender<MSG>>, ) -> Result<(Literal, Right), ErrorInfo>;
}

Required Methods§

Source

fn is_eq(&self, other: &dyn Primitive) -> bool

Source

fn is_cmp(&self, other: &dyn Primitive) -> Option<Ordering>

Source

fn do_add(&self, other: &dyn Primitive) -> Result<Box<dyn Primitive>, String>

Source

fn do_sub(&self, other: &dyn Primitive) -> Result<Box<dyn Primitive>, String>

Source

fn do_div(&self, other: &dyn Primitive) -> Result<Box<dyn Primitive>, String>

Source

fn do_mul(&self, other: &dyn Primitive) -> Result<Box<dyn Primitive>, String>

Source

fn do_rem(&self, other: &dyn Primitive) -> Result<Box<dyn Primitive>, String>

Source

fn as_debug(&self) -> &dyn Debug

Source

fn as_any(&self) -> &dyn Any

Source

fn get_type(&self) -> PrimitiveType

Source

fn as_box_clone(&self) -> Box<dyn Primitive>

Source

fn to_json(&self) -> Value

Source

fn format_mem(&self, content_type: &str, first: bool) -> Value

Source

fn to_string(&self) -> String

Source

fn as_bool(&self) -> bool

Source

fn get_value(&self) -> &dyn Any

Source

fn get_mut_value(&mut self) -> &mut dyn Any

Source

fn to_msg(&self, content_type: String) -> Message

Source

fn do_exec( &mut self, name: &str, args: &HashMap<String, Literal>, mem_type: &MemoryType, additional_info: &Option<HashMap<String, Literal>>, interval: Interval, content_type: &ContentType, data: &mut Data<'_>, msg_data: &mut MessageData, sender: &Option<Sender<MSG>>, ) -> Result<(Literal, Right), ErrorInfo>

Implementations§

Source§

impl dyn Primitive

Source

pub fn exec( &mut self, name: &str, args: &HashMap<String, Literal>, mem_type: &MemoryType, additional_info: &Option<HashMap<String, Literal>>, interval: Interval, content_type: &ContentType, mem_update: &mut bool, data: &mut Data<'_>, msg_data: &mut MessageData, sender: &Option<Sender<MSG>>, ) -> Result<Literal, ErrorInfo>

Trait Implementations§

Source§

impl Add for Box<dyn Primitive>

Source§

type Output = Result<Box<dyn Primitive>, String>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Result<Self, String>

Performs the + operation. Read more
Source§

impl Clone for Box<dyn Primitive>

Source§

fn clone(&self) -> Box<dyn Primitive>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for dyn Primitive

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Box<dyn Primitive>

Source§

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<'de> Deserialize<'de> for Box<dyn Primitive + Send>

Source§

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 Div for Box<dyn Primitive>

Source§

type Output = Result<Box<dyn Primitive>, String>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Result<Self, String>

Performs the / operation. Read more
Source§

impl Mul for Box<dyn Primitive>

Source§

type Output = Result<Box<dyn Primitive>, String>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Result<Self, String>

Performs the * operation. Read more
Source§

impl PartialEq for dyn Primitive

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for dyn Primitive

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem for Box<dyn Primitive>

Source§

type Output = Result<Box<dyn Primitive>, String>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Result<Self, String>

Performs the % operation. Read more
Source§

impl<'typetag> Serialize for dyn Primitive + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn Primitive + Send + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn Primitive + Send + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn Primitive + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Sub for Box<dyn Primitive>

Source§

type Output = Result<Box<dyn Primitive>, String>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Result<Self, String>

Performs the - operation. Read more

Implementors§