Skip to main content

TransformableVariable

Trait TransformableVariable 

Source
pub trait TransformableVariable<View> {
    // Required methods
    fn scaled(&self, scale: i32) -> View;
    fn offset(&self, offset: i32) -> View;
}
Expand description

Trait for transforming a variable.

At the moment this allows creating a scaled version of a variable using TransformableVariable::scaled or creating a variable with a constant offset based on the original variable using TransformableVariable::offset.

Required Methods§

Source

fn scaled(&self, scale: i32) -> View

Get a variable which domain is scaled compared to the domain of self.

The scaled domain will have holes in it. E.g. if we have dom(x) = {1, 2}, then dom(x.scaled(2)) = {2, 4} and not dom(x.scaled(2)) = {1, 2, 3, 4}.

Source

fn offset(&self, offset: i32) -> View

Get a variable which domain has a constant offset to the domain of self.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TransformableVariable<i32> for i32

Source§

fn scaled(&self, scale: i32) -> i32

Source§

fn offset(&self, offset: i32) -> i32

Implementors§