Struct winterfell::TraceInfo
[−]pub struct TraceInfo { /* private fields */ }
Expand description
Information about a specific execution trace.
Trace info consists of trace layout info, length, and optional custom metadata. Trace layout specifies the number of columns for all trace segments. Currently, a trace can consist of at most two segments. Metadata is just a vector of bytes and can store any values up to 64KB in size.
Implementations
impl TraceInfo
impl TraceInfo
pub const MIN_TRACE_LENGTH: usize = 8usize
pub const MIN_TRACE_LENGTH: usize = 8usize
Smallest allowed execution trace length; currently set at 8.
pub const MAX_TRACE_WIDTH: usize = 255usize
pub const MAX_TRACE_WIDTH: usize = 255usize
Maximum number of columns in an execution trace (across all segments); currently set at 255.
pub const MAX_META_LENGTH: usize = 65_535usize
pub const MAX_META_LENGTH: usize = 65_535usize
Maximum number of bytes in trace metadata; currently set at 65535.
pub const MAX_RAND_SEGMENT_ELEMENTS: usize = 255usize
pub const MAX_RAND_SEGMENT_ELEMENTS: usize = 255usize
Maximum number of random elements per auxiliary trace segment; currently set to 255.
pub fn with_meta(
width: usize,
length: usize,
meta: Vec<u8, Global>
) -> TraceInfo
pub fn with_meta(
width: usize,
length: usize,
meta: Vec<u8, Global>
) -> TraceInfo
Creates a new TraceInfo from the specified trace width, length, and metadata.
An execution trace described by this trace info is limited to a single segment.
Panics
Panics if:
- Trace width is zero or greater than 255.
- Trace length is smaller than 8 or is not a power of two.
- Length of
meta
is greater than 65535;
pub fn new_multi_segment(
layout: TraceLayout,
length: usize,
meta: Vec<u8, Global>
) -> TraceInfo
pub fn new_multi_segment(
layout: TraceLayout,
length: usize,
meta: Vec<u8, Global>
) -> TraceInfo
pub fn layout(&self) -> &TraceLayout
pub fn layout(&self) -> &TraceLayout
Returns a description of how execution trace columns are arranged into segments.
Currently, an execution trace can consist of at most two segments.
pub fn width(&self) -> usize
pub fn width(&self) -> usize
Returns the total number of columns in an execution trace.
This is guaranteed to be between 1 and 255.
pub fn length(&self) -> usize
pub fn length(&self) -> usize
Returns execution trace length.
The length is guaranteed to be a power of two.
pub fn meta(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn meta(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Returns execution trace metadata.
pub fn is_multi_segment(&self) -> bool
pub fn is_multi_segment(&self) -> bool
Returns true if an execution trace contains more than one segment.
Trait Implementations
impl Eq for TraceInfo
impl StructuralEq for TraceInfo
impl StructuralPartialEq for TraceInfo
Auto Trait Implementations
impl RefUnwindSafe for TraceInfo
impl Send for TraceInfo
impl Sync for TraceInfo
impl Unpin for TraceInfo
impl UnwindSafe for TraceInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more