pub struct ConstraintSystem {
pub constraints: Vec<BilinearConstraint>,
}
Fields§
§constraints: Vec<BilinearConstraint>
Implementations§
Source§impl ConstraintSystem
impl ConstraintSystem
Sourcepub fn build<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
&'args self,
builder: &'mut_bldr mut FlatBufferBuilder<'bldr>,
) -> WIPOffset<Root<'bldr>>
pub fn build<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( &'args self, builder: &'mut_bldr mut FlatBufferBuilder<'bldr>, ) -> WIPOffset<Root<'bldr>>
Add this structure into a Flatbuffers message builder.
Sourcepub fn write_into(&self, writer: &mut impl Write) -> Result<()>
pub fn write_into(&self, writer: &mut impl Write) -> Result<()>
Writes this constraint system as a Flatbuffers message into the provided buffer.
§Examples
let mut buf = Vec::<u8>::new();
let constraints = zkinterface::ConstraintSystem::from(&[][..]);
constraints.write_into(&mut buf).unwrap();
assert!(buf.len() > 0);
Trait Implementations§
Source§impl Clone for ConstraintSystem
impl Clone for ConstraintSystem
Source§fn clone(&self) -> ConstraintSystem
fn clone(&self) -> ConstraintSystem
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConstraintSystem
impl Debug for ConstraintSystem
Source§impl Default for ConstraintSystem
impl Default for ConstraintSystem
Source§fn default() -> ConstraintSystem
fn default() -> ConstraintSystem
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ConstraintSystem
impl<'de> Deserialize<'de> for ConstraintSystem
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
Source§impl From<&[((Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>))]> for ConstraintSystem
impl From<&[((Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>))]> for ConstraintSystem
Source§fn from(
constraints_vec: &[((Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>))],
) -> ConstraintSystem
fn from( constraints_vec: &[((Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>))], ) -> ConstraintSystem
Creates a ConstraintSystem
from an R1CS vector
§Examples
let constraints_vec: &[((Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>), (Vec<u64>, Vec<u8>))] = &[
// (A ids values) * (B ids values) = (C ids values)
((vec![1], vec![1]), (vec![1], vec![1]), (vec![4], vec![1])), // x * x = xx
((vec![2], vec![1]), (vec![2], vec![1]), (vec![5], vec![1])), // y * y = yy
((vec![0], vec![1]), (vec![4, 5], vec![1, 1]), (vec![3], vec![1])), // 1 * (xx + yy) = z
];
let constraints = zkinterface::ConstraintSystem::from(constraints_vec);
Source§impl<'a> From<ConstraintSystem<'a>> for ConstraintSystem
impl<'a> From<ConstraintSystem<'a>> for ConstraintSystem
Source§fn from(fb_cs: ConstraintSystem<'_>) -> ConstraintSystem
fn from(fb_cs: ConstraintSystem<'_>) -> ConstraintSystem
Convert from Flatbuffers references to owned structure.
Source§impl PartialEq for ConstraintSystem
impl PartialEq for ConstraintSystem
Source§impl Serialize for ConstraintSystem
impl Serialize for ConstraintSystem
Source§impl<'a> TryFrom<&'a [u8]> for ConstraintSystem
impl<'a> TryFrom<&'a [u8]> for ConstraintSystem
impl Eq for ConstraintSystem
impl StructuralPartialEq for ConstraintSystem
Auto Trait Implementations§
impl Freeze for ConstraintSystem
impl RefUnwindSafe for ConstraintSystem
impl Send for ConstraintSystem
impl Sync for ConstraintSystem
impl Unpin for ConstraintSystem
impl UnwindSafe for ConstraintSystem
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.