Enum reverie::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 moresourceimpl 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<CombineOperation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<CombineOperation, <__D as Deserializer<'de>>::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
sourcefn from(op: Operation<bool>) -> CombineOperation
fn from(op: Operation<bool>) -> CombineOperation
Converts to this type from the input type.
sourceimpl From<Operation<u64>> for CombineOperation
impl From<Operation<u64>> for CombineOperation
sourcefn from(op: Operation<u64>) -> CombineOperation
fn from(op: Operation<u64>) -> CombineOperation
Converts to this type from the input type.
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
fn is_identity(&self) -> bool
sourcefn identity(w_out: usize, w_in: usize) -> CombineOperation
fn identity(w_out: usize, w_in: usize) -> CombineOperation
Used to produce an identity gate on the current field when needed.
sourceimpl Identity<u64> for CombineOperation
impl Identity<u64> for CombineOperation
fn is_identity(&self) -> bool
sourcefn identity(w_out: usize, w_in: usize) -> CombineOperation
fn identity(w_out: usize, w_in: usize) -> CombineOperation
Used to produce an identity gate on the current field when needed.
sourceimpl PartialEq<CombineOperation> for CombineOperation
impl PartialEq<CombineOperation> for CombineOperation
sourcefn eq(&self, other: &CombineOperation) -> bool
fn eq(&self, other: &CombineOperation) -> bool
sourceimpl Serialize for CombineOperation
impl Serialize for CombineOperation
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl Translatable for CombineOperation
impl Translatable for CombineOperation
sourcefn translate<I1, I2>(&self, win: I1, wout: I2) -> Option<CombineOperation>where
CombineOperation: Sized,
I1: Iterator<Item = usize>,
I2: Iterator<Item = usize>,
fn translate<I1, I2>(&self, win: I1, wout: I2) -> Option<CombineOperation>where
CombineOperation: 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, RandomState>
) -> 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, RandomState>
) -> 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> Gate<T> for CombineOperationwhere
T: WireValue,
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 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