Enum mcircuit::CombineOperation
source · [−]pub enum CombineOperation {
GF2(Operation<bool>),
Z64(Operation<u64>),
B2A(usize, usize),
SizeHint(usize, usize),
}
Expand description
Wraps Operation
to define a field for each gate. Also supports conversions and metadata.
Variants
GF2(Operation<bool>)
Circuit Operation on GF2 Finite Field
Z64(Operation<u64>)
Circuit Operation on 64-bit integer ring
B2A(usize, usize)
Converts a value on GF2 to a value on Z64. Takes: (dst, src) where src is the low bit of the 64-bit GF2 slice. This means that the least significant bit of the Z64 value will come from the GF2 wire with the lowest index. Make sure your circuits are designed accordingly.
SizeHint(usize, usize)
Information about the number of wires needed to evaluate the circuit. As with B2A, first item is Z64, second is GF2.
Trait Implementations
sourceimpl Clone for CombineOperation
impl Clone for CombineOperation
sourcefn clone(&self) -> CombineOperation
fn clone(&self) -> CombineOperation
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 more
sourceimpl Debug for CombineOperation
impl Debug for CombineOperation
sourceimpl<'de> Deserialize<'de> for CombineOperation
impl<'de> Deserialize<'de> for CombineOperation
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Operation<bool>> for CombineOperation
impl From<Operation<bool>> for CombineOperation
sourceimpl From<Operation<u64>> for CombineOperation
impl From<Operation<u64>> for CombineOperation
sourceimpl HasConst<bool> for CombineOperation
impl HasConst<bool> for CombineOperation
sourceimpl HasConst<u64> for CombineOperation
impl HasConst<u64> for CombineOperation
sourceimpl HasIO for CombineOperation
impl HasIO for CombineOperation
fn inputs(&self) -> InputIterator<'_, CombineOperation>
fn outputs(&self) -> OutputIterator<'_, CombineOperation>
sourceimpl Identity<bool> for CombineOperation
impl Identity<bool> for CombineOperation
sourceimpl Identity<u64> for CombineOperation
impl Identity<u64> for CombineOperation
sourceimpl PartialEq<CombineOperation> for CombineOperation
impl PartialEq<CombineOperation> for CombineOperation
sourcefn eq(&self, other: &CombineOperation) -> bool
fn eq(&self, other: &CombineOperation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CombineOperation) -> bool
fn ne(&self, other: &CombineOperation) -> bool
This method tests for !=
.
sourceimpl Serialize for CombineOperation
impl Serialize for CombineOperation
sourceimpl Translatable for CombineOperation
impl Translatable for CombineOperation
sourcefn translate<'a, I1, I2>(&self, win: I1, wout: I2) -> Option<Self> where
Self: Sized,
I1: Iterator<Item = usize>,
I2: Iterator<Item = usize>,
fn translate<'a, I1, I2>(&self, win: I1, wout: I2) -> Option<Self> where
Self: Sized,
I1: Iterator<Item = usize>,
I2: Iterator<Item = usize>,
takes an iterator of input wires and an iterator of output wires, and creates a new gate of the same type using the inputs and outputs. The current input and output wires have no bearing on the new wires, just the gate type. Read more
sourcefn 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_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>,
Takes a hashmap, and looks for existing wires in the keys. Replaces any existing wire keys with the value from the hashmap. Read more
sourcefn 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>,
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>,
Calls a function on the I/O wires and replaces them with the output of the function.
impl Copy for CombineOperation
impl<T: WireValue> Gate<T> for CombineOperation where
CombineOperation: HasConst<T> + Identity<T>,
impl StructuralPartialEq for CombineOperation
Auto Trait Implementations
impl RefUnwindSafe for CombineOperation
impl Send for CombineOperation
impl Sync for CombineOperation
impl Unpin for CombineOperation
impl UnwindSafe for CombineOperation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more