GenericSdk

Struct GenericSdk 

Source
pub struct GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E>, VB::VmConfig: VmExecutionConfig<F>,
{ /* private fields */ }
Expand description

The SDK provides convenience methods and constructors for provers.

A built SDK is an immutable proving environment: user-supplied config, params, and pre-generated keys are fixed after construction. Use builder for advanced initialization, or new / new_without_transpiler for the common config-driven paths.

Internally, the SDK lazily caches proving state that depends only on the app VM config, aggregation config, root params, and optional pre-generated keys. It does not cache any state that depends on the program executable.

Some commonly used methods are:

Implementations§

Source§

impl<E, VB> GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E>, VB::VmConfig: VmExecutionConfig<F>,

Source

pub fn builder() -> GenericSdkBuilder<E, VB>

Returns a builder for constructing an immutable GenericSdk.

Source

pub fn from_cached_proving_key( cached_pk: SdkCachedProvingKey<VB::VmConfig>, ) -> Result<Self, SdkError>

Builds an SDK from cached proving keys without deferral prover reconstruction.

This generic constructor requires the cached key to have no deferral proving keys. Use from_deferral_cached_proving_key for SdkVmConfig caches that include supported deferral provers.

Source§

impl<E, VB> GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E, VmConfig = SdkVmConfig>,

Source

pub fn from_deferral_cached_proving_key( cached_pk: SdkCachedProvingKey<SdkVmConfig>, ) -> Result<Self, SdkError>
where VB: Default,

Builds an SDK from proving keys returned by GenericSdk::cached_proving_key.

If the cached key includes deferral proving keys, the SDK reads the app VM deferral config to initialize the corresponding supported deferral provers. Custom deferral circuit provers must be manually created and supplied through GenericSdkBuilder::deferral_agg_prover.

Source§

impl<E, VB> GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E>, VB::VmConfig: VmExecutionConfig<F>,

Source

pub fn app_config(&self) -> &AppConfig<VB::VmConfig>

Source

pub fn agg_config(&self) -> &AggregationConfig

Source

pub fn agg_tree_config(&self) -> &AggregationTreeConfig

Source

pub fn root_params(&self) -> &SystemParams

Source

pub fn halo2_shape(&self) -> &StaticVerifierShape

Source

pub fn halo2_config(&self) -> &Halo2Config

Source

pub fn app_vm_builder(&self) -> &VB

Source

pub fn executor(&self) -> &VmExecutor<F, VB::VmConfig>

The executor may be used to construct different types of interpreters, given the program, for more specific execution purposes. By default, it is recommended to use the execute method.

Source

pub fn halo2_params_reader(&self) -> &CacheHalo2ParamsReader

Source§

impl<E, VB> GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E, VmConfig = SdkVmConfig> + Clone + Default,

Source

pub fn standard( app_params: SystemParams, agg_params: AggregationSystemParams, ) -> Self

Creates SDK with a standard configuration that includes a set of default VM extensions loaded.

Note: To use this configuration, your openvm.toml must match SdkVmConfig::standard, including the order of the moduli and elliptic curve parameters of the respective extensions. See the openvm-sdk-config crate documentation for the corresponding TOML.

Source

pub fn riscv32( app_params: SystemParams, agg_params: AggregationSystemParams, ) -> Self

Creates SDK with a configuration with RISC-V RV32IM and IO VM extensions loaded.

Note: To use this configuration, your openvm.toml must match SdkVmConfig::riscv32. See the openvm-sdk-config crate documentation for the corresponding TOML.

Source§

impl<E, VB> GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E>,

Source

pub fn new( app_config: AppConfig<VB::VmConfig>, agg_params: AggregationSystemParams, ) -> Result<Self, SdkError>

Creates SDK custom to the given AppConfig, with a RISC-V transpiler.

Source

pub fn new_without_transpiler( app_config: AppConfig<VB::VmConfig>, agg_params: AggregationSystemParams, ) -> Result<Self, SdkError>
where VB: Default,

Creates an SDK custom to the given AppConfig without configuring a transpiler.

Note: This function does not set the transpiler, which must be done separately to support RISC-V ELFs.

Source

pub fn def_hook_cached_commit(&self) -> Option<Digest>

Returns the def_hook_prover cached commit.

Source

pub fn def_hook_commit(&self) -> Option<Digest>

Returns the deferral hook commit derived from the deferral aggregation path.

Source

pub fn deferral_agg_prover(&self) -> Option<Arc<DeferralAggProver>>

Returns the deferral aggregation prover when this SDK can prove non-empty deferral inputs.

Source

pub fn deferral_circuit_cached_commits( &self, def_idx: usize, ) -> Result<Vec<CommitBytes>, SdkError>

Derives the cached commits that the deferral circuit at def_idx expects callers to fold into its input commit.

Source

pub fn cached_proving_key( &self, ) -> Result<SdkCachedProvingKey<VB::VmConfig>, SdkError>

Returns serde-serializable proving keys for this SDK.

This errors if app_pk or agg_pk have not already been generated or seeded into the SDK. Optional keys are returned only if they are already cached or were seeded into the SDK.

Halo2 proving keys are intentionally excluded; use write_halo2_pk_to_file and read_halo2_pk_from_file for those.

Source

pub fn build<P: AsRef<Path>>( &self, guest_opts: GuestOptions, pkg_dir: P, target_filter: &Option<TargetFilter>, init_file_name: Option<&str>, ) -> Result<Elf, SdkError>

Builds the guest package located at pkg_dir. This function requires that the build target is unique and errors otherwise. Returns the built ELF file decoded in the Elf type.

Source

pub fn transpiler(&self) -> Result<&Transpiler<F>, SdkError>

Transpiler for transpiling RISC-V ELF to OpenVM executable.

Source

pub fn convert_to_exe( &self, executable: impl Into<ExecutableFormat>, ) -> Result<Arc<VmExe<F>>, SdkError>

Normalizes an ELF or executable handle into a shared VmExe.

Source§

impl<E, VB> GenericSdk<E, VB>
where E: StarkEngine<SC = SC>, VB: VmBuilder<E> + Clone, <VB::VmConfig as VmExecutionConfig<F>>::Executor: Executor<F> + MeteredExecutor<F> + PreflightExecutor<F, VB::RecordArena>,

Source

pub fn execute( &self, app_exe: impl Into<ExecutableFormat>, inputs: StdIn, ) -> Result<Vec<u8>, SdkError>

Returns the user public values as field elements.

Source

pub fn execute_metered( &self, app_exe: impl Into<ExecutableFormat>, inputs: StdIn, ) -> Result<(Vec<u8>, Vec<Segment>), SdkError>

Executes with segmentation for proof generation. Returns both user public values and segments with instruction counts and trace heights.

Source

pub fn execute_metered_cost( &self, app_exe: impl Into<ExecutableFormat>, inputs: StdIn, ) -> Result<(Vec<u8>, (u64, u64)), SdkError>

Executes with cost metering to measure computational cost in trace cells. Returns both user public values, and cost along with instruction count.

Source

pub fn prove( &self, app_exe: impl Into<ExecutableFormat>, inputs: StdIn, def_inputs: &[DeferralInput], ) -> Result<(VmStarkProof, VerificationBaseline), SdkError>

Generates a single aggregate STARK proof of the full program execution of the given app_exe with program inputs inputs.\

For convenience, this function also returns the VerificationBaseline, which is a full commitment to the App VmExe and aggregation verifiers. It does not depend on the inputs. It can be generated separately from the proof by creating a prover and calling app_vm_commit.

If STARK aggregation is not needed and a proof whose size may grow linearly with the length of the program runtime is desired, create an app_prover and call app_prover.prove(inputs).

Source

pub fn prove_evm( &self, app_exe: impl Into<ExecutableFormat>, inputs: StdIn, def_inputs: &[DeferralInput], ) -> Result<EvmProof, SdkError>

Generates an EVM-verifiable proof for the given executable and inputs.

Source

pub fn app_prover( &self, exe: impl Into<ExecutableFormat>, ) -> Result<AppProver<E, VB>, SdkError>

This constructor is for generating app proofs that do not require a single aggregate STARK proof of the full program execution. For a single STARK proof, use the prove method instead.

Creates an app prover instance specific to the provided exe. This function will generate the AppProvingKey if it doesn’t already exist and use it to construct the AppProver.

Source

pub fn prover( &self, app_exe: impl Into<ExecutableFormat>, ) -> Result<StarkProver<E, VB>, SdkError>

Constructs a new StarkProver instance for the given executable. This function will generate the AppProvingKey if it does not already exist.

Source

pub fn evm_prover_without_halo2( &self, app_exe: impl Into<ExecutableFormat>, ) -> Result<EvmProver<E, VB>, SdkError>

Constructs an EvmProver for the given executable with only the root prover, generating prerequisite keys, lazily

Source

pub fn evm_prover( &self, app_exe: impl Into<ExecutableFormat>, ) -> Result<EvmProver<E, VB>, SdkError>

Constructs an EvmProver for the given executable, generating prerequisite keys lazily.

Source

pub fn agg_prover(&self) -> Arc<AggProver>

Returns the cached aggregation prover, generating it on first use if needed.

Source

pub fn root_prover(&self) -> Arc<RootProver>

Returns the cached root prover, generating it on first use if needed.

Source

pub fn halo2_prover(&self) -> Halo2Prover

Returns the cached Halo2 prover, generating it on first use if needed.

Source

pub fn app_keygen(&self) -> (AppProvingKey<VB::VmConfig>, AppVerifyingKey)

Generates the app proving key once and caches it. Future calls will return the cached key.

§Panics

This function will panic if the app keygen fails.

Source

pub fn app_pk(&self) -> &AppProvingKey<VB::VmConfig>

Generates the app proving key once and caches it. Future calls will return the cached key.

§Panics

This function will panic if the app keygen fails.

Source

pub fn app_vk(&self) -> AppVerifyingKey

Returns the app verifying key derived from the cached app proving key.

Source

pub fn agg_keygen(&self) -> (AggProvingKey, MultiStarkVerifyingKey<SC>)

Generates or retrieves the aggregation proving and verifying keys as a pair.

Source

pub fn agg_prefix_pk(&self) -> AggPrefixProvingKey

Generates or retrieves the aggregation prefix proving key without the internal-recursive key.

Source

pub fn agg_pk(&self) -> AggProvingKey

Generates or retrieves the full aggregation proving key.

Source

pub fn agg_vk(&self) -> Arc<MultiStarkVerifyingKey<SC>>

Returns the aggregation verifying key for the recursive aggregation layer.

Source

pub fn root_pk(&self) -> RootProvingKey

Generates or retrieves the root proving key and recorded trace heights.

Source

pub fn halo2_pk(&self) -> Halo2ProvingKey

Generates the Halo2 (static verifier + wrapper) proving key once and caches it.

The flow:

  1. Get the root VK and internal recursive VK cached commit
  2. Generate a dummy root proof via the EVM prover pipeline
  3. Keygen the static verifier circuit
  4. Generate a dummy snark from the verifier
  5. Keygen the wrapper circuit (auto-tuned or fixed k)
Source

pub fn app_commit( &self, app_exe: impl Into<ExecutableFormat>, ) -> Result<AppExecutionCommit, SdkError>

Generates the AppExecutionCommit for the given executable.

This function will generate the app_pk if it does not already exist.

Source

pub fn verify_proof( agg_vk: MultiStarkVerifyingKey<SC>, baseline: VerificationBaseline, proof: &VmStarkProof, ) -> Result<(), SdkError>

Verifies aggregate STARK proof of VM execution.

Note: This function does not have any reliance on self and does not depend on the app config set in the Sdk.

Source

pub fn generate_halo2_verifier_solidity( &self, ) -> Result<EvmHalo2Verifier, SdkError>

Generates Solidity verifier artifacts for the cached Halo2 proving key.

Source

pub fn generate_halo2_verifier_solidity_with_version_name( &self, version_name: &str, ) -> Result<EvmHalo2Verifier, SdkError>

Generates Solidity verifier artifacts under src/{version_name} in the solc source map.

Solidity embeds source metadata in bytecode, so version_name should match the directory where the generated verifier contracts will be written.

Source

pub fn verify_evm_halo2_proof( openvm_verifier: &EvmHalo2Verifier, evm_proof: EvmProof, expected_app_commit: Option<AppExecutionCommit>, ) -> Result<u64, SdkError>

Uses the verify(..) interface of the OpenVmHalo2Verifier contract.

Requires the evm-verify feature. Internally deploys the verifier bytecode in a local EVM and executes the verification call. If expected_app_commit is provided, it will check the proof’s app_commit against it.

Auto Trait Implementations§

§

impl<E, VB> !Freeze for GenericSdk<E, VB>

§

impl<E, VB> !RefUnwindSafe for GenericSdk<E, VB>

§

impl<E, VB> !Send for GenericSdk<E, VB>

§

impl<E, VB> !Sync for GenericSdk<E, VB>

§

impl<E, VB> Unpin for GenericSdk<E, VB>
where VB: Unpin, <VB as VmBuilder<E>>::VmConfig: Unpin, E: Unpin,

§

impl<E, VB> !UnwindSafe for GenericSdk<E, VB>

Blanket Implementations§

§

impl<T> AlignerFor<1> for T

§

type Aligner = AlignTo1<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<1024> for T

§

type Aligner = AlignTo1024<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<128> for T

§

type Aligner = AlignTo128<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<16> for T

§

type Aligner = AlignTo16<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<16384> for T

§

type Aligner = AlignTo16384<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<2> for T

§

type Aligner = AlignTo2<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<2048> for T

§

type Aligner = AlignTo2048<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<256> for T

§

type Aligner = AlignTo256<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<32> for T

§

type Aligner = AlignTo32<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<32768> for T

§

type Aligner = AlignTo32768<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<4> for T

§

type Aligner = AlignTo4<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<4096> for T

§

type Aligner = AlignTo4096<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<512> for T

§

type Aligner = AlignTo512<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<64> for T

§

type Aligner = AlignTo64<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<8> for T

§

type Aligner = AlignTo8<T>

The AlignTo* type which aligns Self to ALIGNMENT.
§

impl<T> AlignerFor<8192> for T

§

type Aligner = AlignTo8192<T>

The AlignTo* type which aligns Self to ALIGNMENT.
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
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for T
where T: 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.
§

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

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

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

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

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

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<S> ROExtAcc for S

§

fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F

Gets a reference to a field, determined by offset. Read more
§

fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F

Gets a muatble reference to a field, determined by offset. Read more
§

fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F

Gets a const pointer to a field, the field is determined by offset. Read more
§

fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F

Gets a mutable pointer to a field, determined by offset. Read more
§

impl<S> ROExtOps<Aligned> for S

§

fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more
§

fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Aligned>, right: &mut S)

Swaps a field (determined by offset) with the same field in right. Read more
§

fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> F
where F: Copy,

Gets a copy of a field (determined by offset). The field is determined by offset. Read more
§

impl<S> ROExtOps<Unaligned> for S

§

fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more
§

fn f_swap<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, right: &mut S)

Swaps a field (determined by offset) with the same field in right. Read more
§

fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> F
where F: Copy,

Gets a copy of a field (determined by offset). The field is determined by offset. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<F, Fp, Pt, FC> Selectable<F, Reduced<Pt, Fp>> for FC
where F: BigPrimeField, Pt: Clone, FC: Selectable<F, Pt>,

§

fn select( &self, ctx: &mut Context<F>, a: Reduced<Pt, Fp>, b: Reduced<Pt, Fp>, sel: AssignedValue<F>, ) -> Reduced<Pt, Fp>

§

fn select_by_indicator( &self, ctx: &mut Context<F>, a: &impl AsRef<[Reduced<Pt, Fp>]>, coeffs: &[AssignedValue<F>], ) -> Reduced<Pt, Fp>

§

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

§

fn eq_id(&self, other: &Self) -> bool

Compares the address of self with the address of other. Read more
§

fn piped<F, U>(self, f: F) -> U
where F: FnOnce(Self) -> U, Self: Sized,

Emulates the pipeline operator, allowing method syntax in more places. Read more
§

fn piped_ref<'a, F, U>(&'a self, f: F) -> U
where F: FnOnce(&'a Self) -> U,

The same as piped except that the function takes &Self Useful for functions that take &Self instead of Self. Read more
§

fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U
where F: FnOnce(&'a mut Self) -> U,

The same as piped, except that the function takes &mut Self. Useful for functions that take &mut Self instead of Self.
§

fn mutated<F>(self, f: F) -> Self
where F: FnOnce(&mut Self), Self: Sized,

Mutates self using a closure taking self by mutable reference, passing it along the method chain. Read more
§

fn observe<F>(self, f: F) -> Self
where F: FnOnce(&Self), Self: Sized,

Observes the value of self, passing it along unmodified. Useful in long method chains. Read more
§

fn into_<T>(self) -> T
where Self: Into<T>,

Performs a conversion with Into. using the turbofish .into_::<_>() syntax. Read more
§

fn as_ref_<T>(&self) -> &T
where Self: AsRef<T>, T: ?Sized,

Performs a reference to reference conversion with AsRef, using the turbofish .as_ref_::<_>() syntax. Read more
§

fn as_mut_<T>(&mut self) -> &mut T
where Self: AsMut<T>, T: ?Sized,

Performs a mutable reference to mutable reference conversion with AsMut, using the turbofish .as_mut_::<_>() syntax. Read more
§

fn drop_(self)
where Self: Sized,

Drops self using method notation. Alternative to std::mem::drop. Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<This> TransmuteElement for This
where This: ?Sized,

§

unsafe fn transmute_element<T>(self) -> Self::TransmutedPtr
where Self: CanTransmuteElement<T>,

Transmutes the element type of this pointer.. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

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

Source§

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>,

Source§

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

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

§

type Type = T

This is always Self.
§

fn into_type(self) -> Self::Type
where Self: Sized, Self::Type: Sized,

Converts a value back to the original type.
§

fn as_type(&self) -> &Self::Type

Converts a reference back to the original type.
§

fn as_type_mut(&mut self) -> &mut Self::Type

Converts a mutable reference back to the original type.
§

fn into_type_box(self: Box<Self>) -> Box<Self::Type>

Converts a box back to the original type.
§

fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>

Converts an Arc back to the original type. Read more
§

fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>

Converts an Rc back to the original type. Read more
§

fn from_type(this: Self::Type) -> Self
where Self: Sized, Self::Type: Sized,

Converts a value back to the original type.
§

fn from_type_ref(this: &Self::Type) -> &Self

Converts a reference back to the original type.
§

fn from_type_mut(this: &mut Self::Type) -> &mut Self

Converts a mutable reference back to the original type.
§

fn from_type_box(this: Box<Self::Type>) -> Box<Self>

Converts a box back to the original type.
§

fn from_type_arc(this: Arc<Self::Type>) -> Arc<Self>

Converts an Arc back to the original type.
§

fn from_type_rc(this: Rc<Self::Type>) -> Rc<Self>

Converts an Rc back to the original type.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> SyncDeps for T