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 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.
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 Ident, 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 Ident, 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 idents.
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 Ident, 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 Ident, 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.
§Panics
Panics if owned_table
has duplicate idents.
Panics if owned_table
contains columns of mixed length.
Sourcepub fn try_extend_columns<'a, COL>(
&mut self,
columns: impl IntoIterator<Item = (&'a Ident, 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 Ident, 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 idents.
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 TableCommitment
s 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 TableCommitment
s.
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.
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§const fn clone_from(&mut self, source: &Self)
const 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§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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.