pub struct OracleSchedule { /* private fields */ }Expand description
Every oracle an IOP commits, grouped into the rounds they are committed in.
A round is the run of oracles sent between two challenge samples.
A challenge can only be derived once the commitments before it are absorbed.
So a round closes the moment its challenge is drawn, and takes no further members.
recv, recv, sample, recv, sample, recv, recv, recv
\__________/ \__/ \______________/
round 0 round 1 round 2A flat spec list cannot say where those boundaries fall.
A caller that commits a whole round as one oracle needs them.
Implementations§
Source§impl OracleSchedule
impl OracleSchedule
Sourcepub fn push(&mut self, spec: OracleSpec)
pub fn push(&mut self, spec: OracleSpec)
Appends one oracle to the round currently open.
Sourcepub fn end_round(&mut self)
pub fn end_round(&mut self)
Closes the round currently open, so later oracles start a new one.
Does nothing when no oracle has arrived since the last close.
Calling it wherever a challenge could be drawn is therefore always safe.
Sourcepub fn specs(&self) -> &[OracleSpec]
pub fn specs(&self) -> &[OracleSpec]
Every oracle in the schedule, in arrival order, with round boundaries dropped.
Sourcepub fn into_specs(self) -> Vec<OracleSpec>
pub fn into_specs(self) -> Vec<OracleSpec>
Consumes the schedule and returns every oracle, with round boundaries dropped.
Sourcepub fn rounds(&self) -> impl Iterator<Item = &[OracleSpec]>
pub fn rounds(&self) -> impl Iterator<Item = &[OracleSpec]>
The oracles of each closed round, in commit order.
Sourcepub fn merged_specs(&self) -> Vec<OracleSpec>
pub fn merged_specs(&self) -> Vec<OracleSpec>
One spec per round: the oracle that round’s oracles are committed as.
This is the coarser list an underlying channel is configured with.
A round is masked as a whole, so its oracle is zero-knowledge if any member is.
Trait Implementations§
Source§impl Clone for OracleSchedule
impl Clone for OracleSchedule
Source§fn clone(&self) -> OracleSchedule
fn clone(&self) -> OracleSchedule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OracleSchedule
impl Debug for OracleSchedule
Source§impl Default for OracleSchedule
impl Default for OracleSchedule
Source§fn default() -> OracleSchedule
fn default() -> OracleSchedule
impl Eq for OracleSchedule
Source§impl PartialEq for OracleSchedule
impl PartialEq for OracleSchedule
Source§fn eq(&self, other: &OracleSchedule) -> bool
fn eq(&self, other: &OracleSchedule) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OracleSchedule
Auto Trait Implementations§
impl Freeze for OracleSchedule
impl RefUnwindSafe for OracleSchedule
impl Send for OracleSchedule
impl Sync for OracleSchedule
impl Unpin for OracleSchedule
impl UnsafeUnpin for OracleSchedule
impl UnwindSafe for OracleSchedule
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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