Struct aflak_cake::Transformation
source · pub struct Transformation<T: Clone, E> {
pub name: TransformId,
pub description: Cow<'static, str>,
pub input: Vec<(TypeId, Option<T>)>,
pub output: Vec<TypeId>,
pub algorithm: Algorithm<T, E>,
}
Expand description
A transformation defined by an Algorithm
, with a determined number of
inputs and outputs.
Fields
name: TransformId
Transformation name
description: Cow<'static, str>
input: Vec<(TypeId, Option<T>)>
Inputs of the transformation, may include a default value
output: Vec<TypeId>
Outputs of the transformation
algorithm: Algorithm<T, E>
Algorithm defining the transformation
Implementations
sourceimpl<T, E> Transformation<T, E>where
T: Clone + VariantName,
impl<T, E> Transformation<T, E>where
T: Clone + VariantName,
sourcepub fn new_constant(t: T) -> Self
pub fn new_constant(t: T) -> Self
Create a new Transformation always returning a single constant
sourcepub fn set_constant(&mut self, t: T)
pub fn set_constant(&mut self, t: T)
Set this transformation to the given constant value.
sourceimpl<T, E> Transformation<T, E>where
T: Clone,
impl<T, E> Transformation<T, E>where
T: Clone,
sourcepub fn start(&self) -> TransformationCaller<'_, '_, T, E>
pub fn start(&self) -> TransformationCaller<'_, '_, T, E>
Ready the transformation to be called.
sourcepub fn output_exists(&self, output_i: usize) -> bool
pub fn output_exists(&self, output_i: usize) -> bool
Check that output exists for the transform
sourcepub fn input_exists(&self, input_i: usize) -> bool
pub fn input_exists(&self, input_i: usize) -> bool
Check that input exists for the transform
sourcepub fn nth_output_type(&self, output_i: usize) -> TypeId
pub fn nth_output_type(&self, output_i: usize) -> TypeId
Return nth output type. Panic if output_i > self.output.len()
sourcepub fn nth_input_type(&self, input_i: usize) -> TypeId
pub fn nth_input_type(&self, input_i: usize) -> TypeId
Return nth input type. Panic if input_i > self.input.len()
Trait Implementations
sourceimpl<T: Clone + Clone, E: Clone> Clone for Transformation<T, E>
impl<T: Clone + Clone, E: Clone> Clone for Transformation<T, E>
sourcefn clone(&self) -> Transformation<T, E>
fn clone(&self) -> Transformation<T, E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl<T, E> RefUnwindSafe for Transformation<T, E>where
T: RefUnwindSafe,
impl<T, E> Send for Transformation<T, E>where
T: Send,
impl<T, E> Sync for Transformation<T, E>where
T: Sync,
impl<T, E> Unpin for Transformation<T, E>where
T: Unpin,
impl<T, E> UnwindSafe for Transformation<T, E>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more