pub trait VecCommitmentExt {
type CommitmentPublicSetup<'a>;
// Required methods
fn from_columns_with_offset<'a, C>(
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Self
where C: Into<CommittableColumn<'a>>;
fn from_committable_columns_with_offset(
committable_columns: &[CommittableColumn<'_>],
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Self;
fn try_append_rows_with_offset<'a, C>(
&mut self,
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Result<(), NumColumnsMismatch>
where C: Into<CommittableColumn<'a>>;
fn extend_columns_with_offset<'a, C>(
&mut self,
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
)
where C: Into<CommittableColumn<'a>>;
fn try_add(self, other: Self) -> Result<Self, NumColumnsMismatch>
where Self: Sized;
fn try_sub(self, other: Self) -> Result<Self, NumColumnsMismatch>
where Self: Sized;
fn num_commitments(&self) -> usize;
}
Expand description
Extension trait intended for collections of commitments.
Implemented for Vec<CompressedRistretto>
.
Required Associated Types§
Sourcetype CommitmentPublicSetup<'a>
type CommitmentPublicSetup<'a>
The public setup parameters required to compute the commitments. This is simply precomputed data that is required to compute the commitments.
Required Methods§
Sourcefn from_columns_with_offset<'a, C>(
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Selfwhere
C: Into<CommittableColumn<'a>>,
fn from_columns_with_offset<'a, C>(
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Selfwhere
C: Into<CommittableColumn<'a>>,
Returns a collection of commitments to the provided columns using the given generator offset.
Sourcefn from_committable_columns_with_offset(
committable_columns: &[CommittableColumn<'_>],
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Self
fn from_committable_columns_with_offset( committable_columns: &[CommittableColumn<'_>], offset: usize, setup: &Self::CommitmentPublicSetup<'_>, ) -> Self
Returns a collection of commitments to the provided slice of CommittableColumn
s using the given generator offset.
Sourcefn try_append_rows_with_offset<'a, C>(
&mut self,
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Result<(), NumColumnsMismatch>where
C: Into<CommittableColumn<'a>>,
fn try_append_rows_with_offset<'a, C>(
&mut self,
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
) -> Result<(), NumColumnsMismatch>where
C: Into<CommittableColumn<'a>>,
Append rows of data from the provided columns to the existing commitments.
The given generator offset will be used for committing to the new rows. You most likely want this to be equal to the 0-indexed row number of the first new row.
The number of columns provided must match the number of columns already committed to.
Sourcefn extend_columns_with_offset<'a, C>(
&mut self,
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
)where
C: Into<CommittableColumn<'a>>,
fn extend_columns_with_offset<'a, C>(
&mut self,
columns: impl IntoIterator<Item = C>,
offset: usize,
setup: &Self::CommitmentPublicSetup<'_>,
)where
C: Into<CommittableColumn<'a>>,
Add commitments to new columns to this collection using the given generator offset.
Sourcefn try_add(self, other: Self) -> Result<Self, NumColumnsMismatch>where
Self: Sized,
fn try_add(self, other: Self) -> Result<Self, NumColumnsMismatch>where
Self: Sized,
Add two collections of commitments if they have equal column counts.
Sourcefn try_sub(self, other: Self) -> Result<Self, NumColumnsMismatch>where
Self: Sized,
fn try_sub(self, other: Self) -> Result<Self, NumColumnsMismatch>where
Self: Sized,
Subtract two collections of commitments if they have equal column counts.
Sourcefn num_commitments(&self) -> usize
fn num_commitments(&self) -> usize
Returns the number of commitments in the collection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.