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§

source§

impl TraceInfo

source

pub const MIN_TRACE_LENGTH: usize = 8usize

Smallest allowed execution trace length; currently set at 8.

source

pub const MAX_TRACE_WIDTH: usize = 255usize

Maximum number of columns in an execution trace (across all segments); currently set at 255.

source

pub const MAX_META_LENGTH: usize = 65_535usize

Maximum number of bytes in trace metadata; currently set at 65535.

source

pub const MAX_RAND_SEGMENT_ELEMENTS: usize = 255usize

Maximum number of random elements per auxiliary trace segment; currently set to 255.

source

pub fn new(width: usize, length: usize) -> TraceInfo

Creates a new TraceInfo from the specified trace width and length.

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.
source

pub fn with_meta(width: usize, length: usize, meta: Vec<u8>) -> 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;
source

pub fn new_multi_segment( layout: TraceLayout, length: usize, meta: Vec<u8> ) -> TraceInfo

Creates a new TraceInfo from the specified trace segment widths, length, and metadata.

§Panics

Panics if:

  • The width of the first trace segment is zero.
  • Total width of all trace segments is greater than 255.
  • Trace length is smaller than 8 or is not a power of two.
source

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.

source

pub fn width(&self) -> usize

Returns the total number of columns in an execution trace.

This is guaranteed to be between 1 and 255.

source

pub fn length(&self) -> usize

Returns execution trace length.

The length is guaranteed to be a power of two.

source

pub fn meta(&self) -> &[u8]

Returns execution trace metadata.

source

pub fn is_multi_segment(&self) -> bool

Returns true if an execution trace contains more than one segment.

Trait Implementations§

source§

impl Clone for TraceInfo

source§

fn clone(&self) -> TraceInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TraceInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl PartialEq for TraceInfo

source§

fn eq(&self, other: &TraceInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for TraceInfo

source§

impl StructuralPartialEq for TraceInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.