pub trait Translatable {
// Required method
fn translate<I1, I2>(&self, win: I1, wout: I2) -> Option<Self>
where Self: Sized,
I1: Iterator<Item = usize>,
I2: Iterator<Item = usize>;
// Provided methods
fn translate_from_hashmap<'a>(
&'a self,
translation_table: HashMap<usize, usize>,
) -> Option<Self>
where Self: Sized + HasIO,
InputIterator<'a, Self>: Iterator<Item = usize>,
OutputIterator<'a, Self>: Iterator<Item = usize> { ... }
fn translate_from_fn<'a>(
&'a self,
input_mapper: fn(usize) -> usize,
output_mapper: fn(usize) -> usize,
) -> Option<Self>
where Self: Sized + HasIO,
InputIterator<'a, Self>: Iterator<Item = usize>,
OutputIterator<'a, Self>: Iterator<Item = usize> { ... }
}
Expand description
Defines a number of helper methods for replacing the I/O wires on a gate with new ones
Required Methods§
Provided Methods§
Sourcefn translate_from_hashmap<'a>(
&'a self,
translation_table: HashMap<usize, usize>,
) -> Option<Self>
fn translate_from_hashmap<'a>( &'a self, translation_table: HashMap<usize, usize>, ) -> Option<Self>
Takes a hashmap, and looks for existing wires in the keys. Replaces any existing wire keys with the value from the hashmap.