Trait Variable

Source
pub trait Variable:
    DynClone
    + Send
    + Sync
    + Debug
    + Display
    + Serialize
    + Deserialize {
    // Required method
    fn value(&self, event: &Event) -> f64;

    // Provided methods
    fn value_on_local(&self, dataset: &Dataset) -> Vec<f64> { ... }
    fn value_on(&self, dataset: &Dataset) -> Vec<f64> { ... }
    fn eq(&self, val: f64) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn lt(&self, val: f64) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn gt(&self, val: f64) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn ge(&self, val: f64) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn le(&self, val: f64) -> VariableExpression
       where Self: Sized + 'static { ... }
}
Expand description

Standard methods for extracting some value out of an Event.

Required Methods§

Source

fn value(&self, event: &Event) -> f64

This method takes an Event and extracts a single value (like the mass of a particle).

Provided Methods§

Source

fn value_on_local(&self, dataset: &Dataset) -> Vec<f64>

This method distributes the Variable::value method over each Event in a Dataset (non-MPI version).

§Notes

This method is not intended to be called in analyses but rather in writing methods that have mpi-feature-gated versions. Most users should just call Variable::value_on instead.

Source

fn value_on(&self, dataset: &Dataset) -> Vec<f64>

This method distributes the Variable::value method over each Event in a Dataset.

Source

fn eq(&self, val: f64) -> VariableExpression
where Self: Sized + 'static,

Create an VariableExpression that evaluates to self == val

Source

fn lt(&self, val: f64) -> VariableExpression
where Self: Sized + 'static,

Create an VariableExpression that evaluates to self < val

Source

fn gt(&self, val: f64) -> VariableExpression
where Self: Sized + 'static,

Create an VariableExpression that evaluates to self > val

Source

fn ge(&self, val: f64) -> VariableExpression
where Self: Sized + 'static,

Create an VariableExpression that evaluates to self >= val

Source

fn le(&self, val: f64) -> VariableExpression
where Self: Sized + 'static,

Create an VariableExpression that evaluates to self <= val

Trait Implementations§

Source§

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

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Box<dyn Variable>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'de> Deserialize<'de> for Box<dyn Variable + Send>

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Box<dyn Variable + Send>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'de> Deserialize<'de> for Box<dyn Variable + Sync + Send>

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Box<dyn Variable + Sync + Send>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'de> Deserialize<'de> for Box<dyn Variable + Sync>

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Box<dyn Variable + Sync>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

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

Source§

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

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

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

Source§

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

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

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

Source§

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

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

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

Source§

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

Serialize this value into the given Serde serializer. Read more

Implementors§