Trait Variable

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

    // Provided methods
    fn value_on_local(&self, dataset: &Dataset) -> Vec<Float>  { ... }
    fn value_on(&self, dataset: &Dataset) -> Vec<Float>  { ... }
    fn eq(&self, val: Float) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn lt(&self, val: Float) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn gt(&self, val: Float) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn ge(&self, val: Float) -> VariableExpression
       where Self: Sized + 'static { ... }
    fn le(&self, val: Float) -> 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) -> Float

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<Float>

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<Float>

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

Source

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

Create an VariableExpression that evaluates to self == val

Source

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

Create an VariableExpression that evaluates to self < val

Source

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

Create an VariableExpression that evaluates to self > val

Source

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

Create an VariableExpression that evaluates to self >= val

Source

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

Create an VariableExpression that evaluates to self <= val

Trait Implementations§

Source§

impl<'typetag> Serialize for dyn Variable + '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 Variable + 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 Variable + 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 Variable + 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

Implementors§