pub struct MemOp<F> {
pub operation: Expression<F>,
pub index: Expression<F>,
pub value: Expression<F>,
}Expand description
Operation on a block of memory We can either write or read at an index in memory
Fields§
§operation: Expression<F>A constant expression that can be 0 (read) or 1 (write)
index: Expression<F>array index, it must be less than the array length
value: Expression<F>the value we are reading, when operation is 0, or the value we write at the specified index, when operation is 1
Implementations§
Source§impl<F: AcirField> MemOp<F>
impl<F: AcirField> MemOp<F>
Sourcepub fn read_at_mem_index(index: Expression<F>, witness: Witness) -> Self
pub fn read_at_mem_index(index: Expression<F>, witness: Witness) -> Self
Creates a MemOp which reads from memory at index and inserts the read value
into the WitnessMap at witness
Sourcepub fn write_to_mem_index(index: Expression<F>, value: Expression<F>) -> Self
pub fn write_to_mem_index(index: Expression<F>, value: Expression<F>) -> Self
Creates a MemOp which writes the Expression value into memory at index.
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for MemOp<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for MemOp<F>where
F: Deserialize<'de>,
Source§fn 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
impl<F: Eq> Eq for MemOp<F>
impl<F> StructuralPartialEq for MemOp<F>
Auto Trait Implementations§
impl<F> Freeze for MemOp<F>where
F: Freeze,
impl<F> RefUnwindSafe for MemOp<F>where
F: RefUnwindSafe,
impl<F> Send for MemOp<F>where
F: Send,
impl<F> Sync for MemOp<F>where
F: Sync,
impl<F> Unpin for MemOp<F>where
F: Unpin,
impl<F> UnwindSafe for MemOp<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more