pub struct SP1Context<'a> {
pub hook_registry: Option<HookRegistry<'a>>,
pub subproof_verifier: Option<&'a dyn SubproofVerifier>,
pub max_cycles: Option<u64>,
pub deferred_proof_verification: bool,
pub calculate_gas: bool,
pub io_options: IoOptions<'a>,
}
Expand description
Context to run a program inside SP1.
Fields§
§hook_registry: Option<HookRegistry<'a>>
The registry of hooks invocable from inside SP1.
Note: None
denotes the default list of hooks.
subproof_verifier: Option<&'a dyn SubproofVerifier>
The verifier for verifying subproofs.
max_cycles: Option<u64>
The maximum number of cpu cycles to use for execution.
deferred_proof_verification: bool
Deferred proof verification.
calculate_gas: bool
Whether gas (available in the ExecutionReport
) should be calculated during execution.
Does nothing while proving.
This option will noticeably slow down execution, so it should be disabled in most cases.
io_options: IoOptions<'a>
The IO options for the [SP1Executor
].
Implementations§
Source§impl<'a> SP1Context<'a>
impl<'a> SP1Context<'a>
Sourcepub fn builder() -> SP1ContextBuilder<'a>
pub fn builder() -> SP1ContextBuilder<'a>
Create a new context builder. See SP1ContextBuilder
for more details.
Trait Implementations§
Source§impl<'a> Clone for SP1Context<'a>
impl<'a> Clone for SP1Context<'a>
Source§fn clone(&self) -> SP1Context<'a>
fn clone(&self) -> SP1Context<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for SP1Context<'a>
impl<'a> !RefUnwindSafe for SP1Context<'a>
impl<'a> Send for SP1Context<'a>
impl<'a> !Sync for SP1Context<'a>
impl<'a> Unpin for SP1Context<'a>
impl<'a> !UnwindSafe for SP1Context<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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