pub struct Context { /* private fields */ }Expand description
Basic metadata about a specific execution of a computation.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new<B>(trace_info: TraceInfo, options: ProofOptions) -> Contextwhere
B: StarkField,
pub fn new<B>(trace_info: TraceInfo, options: ProofOptions) -> Contextwhere
B: StarkField,
Sourcepub fn trace_info(&self) -> &TraceInfo
pub fn trace_info(&self) -> &TraceInfo
Returns execution trace info for the computation described by this context.
Sourcepub fn lde_domain_size(&self) -> usize
pub fn lde_domain_size(&self) -> usize
Returns the size of the LDE domain for the computation described by this context.
Sourcepub fn field_modulus_bytes(&self) -> &[u8] ⓘ
pub fn field_modulus_bytes(&self) -> &[u8] ⓘ
Returns modulus of the field for the computation described by this context.
Sourcepub fn num_modulus_bits(&self) -> u32
pub fn num_modulus_bits(&self) -> u32
Returns number of bits in the base field modulus for the computation described by this context.
The modulus is assumed to be encoded in little-endian byte order.
Sourcepub fn options(&self) -> &ProofOptions
pub fn options(&self) -> &ProofOptions
Returns proof options which were used to a proof in this context.
Trait Implementations§
Source§impl Deserializable for Context
impl Deserializable for Context
Source§fn read_from<R>(source: &mut R) -> Result<Context, DeserializationError>where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<Context, DeserializationError>where
R: ByteReader,
Reads proof context from the specified source and returns the result.
§Errors
Returns an error of a valid Context struct could not be read from the specified source.
Source§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
Source§impl Serializable for Context
impl Serializable for Context
Source§fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W)where
W: ByteWriter,
Serializes self and writes the resulting bytes into the target.
Source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Source§impl<E> ToElements<E> for Contextwhere
E: StarkField,
impl<E> ToElements<E> for Contextwhere
E: StarkField,
Source§fn to_elements(&self) -> Vec<E>
fn to_elements(&self) -> Vec<E>
Converts this Context into a vector of field elements.
The elements are laid out as follows:
- trace info [2 or more elements].
- field modulus bytes [2 field elements].
- field extension and FRI parameters [1 element].
- grinding factor [1 element].
- blowup factor [1 element].
- number of queries [1 element].
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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)