Struct proof_of_sql::base::commitment::TableCommitment   
source · pub struct TableCommitment<C>where
    C: Commitment,{ /* private fields */ }Expand description
Commitment for an entire table, with column and table metadata.
Unlike ColumnCommitments, all columns in this commitment must have the same length.
Implementations§
source§impl<C: Commitment> TableCommitment<C>
 
impl<C: Commitment> TableCommitment<C>
sourcepub fn from_accessor_with_max_bounds(
    table_ref: TableRef,
    columns: &[ColumnField],
    accessor: &impl CommitmentAccessor<C>,
) -> Self
 
pub fn from_accessor_with_max_bounds( table_ref: TableRef, columns: &[ColumnField], accessor: &impl CommitmentAccessor<C>, ) -> Self
Create a new TableCommitment for a table from a commitment accessor.
sourcepub fn try_new(
    column_commitments: ColumnCommitments<C>,
    range: Range<usize>,
) -> Result<Self, NegativeRange>
 
pub fn try_new( column_commitments: ColumnCommitments<C>, range: Range<usize>, ) -> Result<Self, NegativeRange>
Construct a new TableCommitment.
Will error if the range is “negative”, i.e. if its end < start.
sourcepub fn column_commitments(&self) -> &ColumnCommitments<C>
 
pub fn column_commitments(&self) -> &ColumnCommitments<C>
Returns a reference to this type’s internal ColumnCommitments.
sourcepub fn range(&self) -> &Range<usize>
 
pub fn range(&self) -> &Range<usize>
Returns a reference to the range of rows this type commits to.
sourcepub fn num_columns(&self) -> usize
 
pub fn num_columns(&self) -> usize
Returns the number of columns in the committed table.
sourcepub fn try_from_columns_with_offset<'a, COL>(
    columns: impl IntoIterator<Item = (&'a Identifier, COL)>,
    offset: usize,
    setup: &C::PublicSetup<'_>,
) -> Result<TableCommitment<C>, TableCommitmentFromColumnsError>where
    COL: Into<CommittableColumn<'a>>,
 
pub fn try_from_columns_with_offset<'a, COL>(
    columns: impl IntoIterator<Item = (&'a Identifier, COL)>,
    offset: usize,
    setup: &C::PublicSetup<'_>,
) -> Result<TableCommitment<C>, TableCommitmentFromColumnsError>where
    COL: Into<CommittableColumn<'a>>,
Returns a TableCommitment to the provided columns with the given row offset.
Provided columns must have the same length and no duplicate identifiers.
sourcepub fn from_owned_table_with_offset<S>(
    owned_table: &OwnedTable<S>,
    offset: usize,
    setup: &C::PublicSetup<'_>,
) -> TableCommitment<C>where
    S: Scalar,
 
pub fn from_owned_table_with_offset<S>(
    owned_table: &OwnedTable<S>,
    offset: usize,
    setup: &C::PublicSetup<'_>,
) -> TableCommitment<C>where
    S: Scalar,
Returns a TableCommitment to the provided table with the given row offset.
sourcepub fn try_append_rows<'a, COL>(
    &mut self,
    columns: impl IntoIterator<Item = (&'a Identifier, COL)>,
    setup: &C::PublicSetup<'_>,
) -> Result<(), AppendTableCommitmentError>where
    COL: Into<CommittableColumn<'a>>,
 
pub fn try_append_rows<'a, COL>(
    &mut self,
    columns: impl IntoIterator<Item = (&'a Identifier, COL)>,
    setup: &C::PublicSetup<'_>,
) -> Result<(), AppendTableCommitmentError>where
    COL: Into<CommittableColumn<'a>>,
Append rows of data from the provided columns to the existing TableCommitment.
The row offset is assumed to be the end of the TableCommitment’s current range.
Will error on a variety of mismatches, or if the provided columns have mixed length.
sourcepub fn append_owned_table<S>(
    &mut self,
    owned_table: &OwnedTable<S>,
    setup: &C::PublicSetup<'_>,
) -> Result<(), ColumnCommitmentsMismatch>where
    S: Scalar,
 
pub fn append_owned_table<S>(
    &mut self,
    owned_table: &OwnedTable<S>,
    setup: &C::PublicSetup<'_>,
) -> Result<(), ColumnCommitmentsMismatch>where
    S: Scalar,
Append data of the provided table to the exiting TableCommitment.
Will error on a variety of mismatches.
See ColumnCommitmentsMismatch for an enumeration of these errors.
sourcepub fn try_extend_columns<'a, COL>(
    &mut self,
    columns: impl IntoIterator<Item = (&'a Identifier, COL)>,
    setup: &C::PublicSetup<'_>,
) -> Result<(), TableCommitmentFromColumnsError>where
    COL: Into<CommittableColumn<'a>>,
 
pub fn try_extend_columns<'a, COL>(
    &mut self,
    columns: impl IntoIterator<Item = (&'a Identifier, COL)>,
    setup: &C::PublicSetup<'_>,
) -> Result<(), TableCommitmentFromColumnsError>where
    COL: Into<CommittableColumn<'a>>,
Add new columns to this TableCommitment.
Columns must have the same length as the current commitment and no duplicate identifiers.
sourcepub fn try_add(
    self,
    other: Self,
) -> Result<Self, TableCommitmentArithmeticError>where
    Self: Sized,
 
pub fn try_add(
    self,
    other: Self,
) -> Result<Self, TableCommitmentArithmeticError>where
    Self: Sized,
Add two TableCommitments together.
self must end where other begins, or vice versa.
Otherwise, TableCommitmentArithmeticError::NonContiguous is returned.
This will also error on a variety of mismatches.
See ColumnCommitmentsMismatch for an enumeration of these errors.
sourcepub fn try_sub(
    self,
    other: Self,
) -> Result<Self, TableCommitmentArithmeticError>where
    Self: Sized,
 
pub fn try_sub(
    self,
    other: Self,
) -> Result<Self, TableCommitmentArithmeticError>where
    Self: Sized,
Subtract two TableCommitments.
self and other must begin at the same row number or end at the same row number.
Otherwise, TableCommitmentArithmeticError::NonContiguous is returned.
Furthermore, other’s range must be smaller or equal to self’s.
Otherwise, TableCommitmentArithmeticError::NegativeRange is returned.
This will also error on a variety of mismatches.
See ColumnCommitmentsMismatch for an enumeration of these errors.
sourcepub fn try_append_record_batch(
    &mut self,
    batch: &RecordBatch,
    setup: &C::PublicSetup<'_>,
) -> Result<(), AppendRecordBatchTableCommitmentError>
 
pub fn try_append_record_batch( &mut self, batch: &RecordBatch, setup: &C::PublicSetup<'_>, ) -> Result<(), AppendRecordBatchTableCommitmentError>
Append an arrow RecordBatch to the existing TableCommitment.
The row offset is assumed to be the end of the TableCommitment’s current range.
Will error on a variety of mismatches, or if the provided columns have mixed length.
sourcepub fn try_from_record_batch(
    batch: &RecordBatch,
    setup: &C::PublicSetup<'_>,
) -> Result<TableCommitment<C>, RecordBatchToColumnsError>
 
pub fn try_from_record_batch( batch: &RecordBatch, setup: &C::PublicSetup<'_>, ) -> Result<TableCommitment<C>, RecordBatchToColumnsError>
Returns a TableCommitment to the provided arrow RecordBatch.
sourcepub fn try_from_record_batch_with_offset(
    batch: &RecordBatch,
    offset: usize,
    setup: &C::PublicSetup<'_>,
) -> Result<TableCommitment<C>, RecordBatchToColumnsError>
 
pub fn try_from_record_batch_with_offset( batch: &RecordBatch, offset: usize, setup: &C::PublicSetup<'_>, ) -> Result<TableCommitment<C>, RecordBatchToColumnsError>
Returns a TableCommitment to the provided arrow RecordBatch with the given row offset.
Trait Implementations§
source§impl<C> Clone for TableCommitment<C>where
    C: Commitment + Clone,
 
impl<C> Clone for TableCommitment<C>where
    C: Commitment + Clone,
source§fn clone(&self) -> TableCommitment<C>
 
fn clone(&self) -> TableCommitment<C>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<C> Debug for TableCommitment<C>where
    C: Commitment + Debug,
 
impl<C> Debug for TableCommitment<C>where
    C: Commitment + Debug,
source§impl<C> Default for TableCommitment<C>where
    C: Commitment + Default,
 
impl<C> Default for TableCommitment<C>where
    C: Commitment + Default,
source§fn default() -> TableCommitment<C>
 
fn default() -> TableCommitment<C>
source§impl<'de, C> Deserialize<'de> for TableCommitment<C>where
    C: Commitment + Deserialize<'de>,
 
impl<'de, C> Deserialize<'de> for TableCommitment<C>where
    C: Commitment + 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>,
source§impl<C> PartialEq for TableCommitment<C>where
    C: Commitment + PartialEq,
 
impl<C> PartialEq for TableCommitment<C>where
    C: Commitment + PartialEq,
source§impl<C> Serialize for TableCommitment<C>where
    C: Commitment + Serialize,
 
impl<C> Serialize for TableCommitment<C>where
    C: Commitment + Serialize,
impl<C> Eq for TableCommitment<C>where
    C: Commitment + Eq,
impl<C> StructuralPartialEq for TableCommitment<C>where
    C: Commitment,
Auto Trait Implementations§
impl<C> Freeze for TableCommitment<C>
impl<C> RefUnwindSafe for TableCommitment<C>where
    C: RefUnwindSafe,
impl<C> Send for TableCommitment<C>
impl<C> Sync for TableCommitment<C>
impl<C> Unpin for TableCommitment<C>where
    C: Unpin,
impl<C> UnwindSafe for TableCommitment<C>where
    C: 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
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)
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.source§impl<T> Instrument for T
 
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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