pub struct SP1Prover<C = CpuProverComponents>where
C: SP1ProverComponents,{Show 16 fields
pub core_prover: <C as SP1ProverComponents>::CoreProver,
pub compress_prover: <C as SP1ProverComponents>::CompressProver,
pub shrink_prover: <C as SP1ProverComponents>::ShrinkProver,
pub wrap_prover: <C as SP1ProverComponents>::WrapProver,
pub lift_programs_lru: Mutex<LruCache<SP1RecursionShape, Arc<RecursionProgram<BabyBear>>>>,
pub lift_cache_misses: AtomicUsize,
pub join_programs_map: BTreeMap<SP1CompressWithVkeyShape, Arc<RecursionProgram<BabyBear>>>,
pub join_cache_misses: AtomicUsize,
pub recursion_vk_root: <BabyBearPoseidon2 as FieldHasher<BabyBear>>::Digest,
pub recursion_vk_map: BTreeMap<<BabyBearPoseidon2 as FieldHasher<BabyBear>>::Digest, usize>,
pub recursion_vk_tree: MerkleTree<BabyBear, BabyBearPoseidon2>,
pub core_shape_config: Option<CoreShapeConfig<BabyBear>>,
pub compress_shape_config: Option<RecursionShapeConfig<BabyBear, RecursionAir<BabyBear, sp1_prover::::CompressAir::{constant#0}>>>,
pub wrap_program: OnceLock<Arc<RecursionProgram<BabyBear>>>,
pub wrap_vk: OnceLock<StarkVerifyingKey<BabyBearPoseidon2Outer>>,
pub vk_verification: bool,
}
Expand description
A end-to-end for the SP1 RISC-V zkVM.
This object coordinates the proving along all the steps: core, compression, shrinkage, and wrapping.
Fields§
§core_prover: <C as SP1ProverComponents>::CoreProver
The core prover.
compress_prover: <C as SP1ProverComponents>::CompressProver
The compress prover (for both lift and join).
shrink_prover: <C as SP1ProverComponents>::ShrinkProver
The shrink prover.
wrap_prover: <C as SP1ProverComponents>::WrapProver
The wrap prover.
lift_programs_lru: Mutex<LruCache<SP1RecursionShape, Arc<RecursionProgram<BabyBear>>>>
The cache of compiled recursion programs.
lift_cache_misses: AtomicUsize
The number of cache misses for recursion programs.
join_programs_map: BTreeMap<SP1CompressWithVkeyShape, Arc<RecursionProgram<BabyBear>>>
The cache of compiled compression programs.
join_cache_misses: AtomicUsize
The number of cache misses for compression programs.
recursion_vk_root: <BabyBearPoseidon2 as FieldHasher<BabyBear>>::Digest
The root of the allowed recursion verification keys.
recursion_vk_map: BTreeMap<<BabyBearPoseidon2 as FieldHasher<BabyBear>>::Digest, usize>
The allowed VKs and their corresponding indices.
recursion_vk_tree: MerkleTree<BabyBear, BabyBearPoseidon2>
The Merkle tree for the allowed VKs.
core_shape_config: Option<CoreShapeConfig<BabyBear>>
The core shape configuration.
compress_shape_config: Option<RecursionShapeConfig<BabyBear, RecursionAir<BabyBear, sp1_prover::::CompressAir::{constant#0}>>>
The recursion shape configuration.
wrap_program: OnceLock<Arc<RecursionProgram<BabyBear>>>
The program for wrapping.
wrap_vk: OnceLock<StarkVerifyingKey<BabyBearPoseidon2Outer>>
The verifying key for wrapping.
vk_verification: bool
Whether to verify verification keys.
Implementations§
Source§impl<C> SP1Prover<C>where
C: SP1ProverComponents,
impl<C> SP1Prover<C>where
C: SP1ProverComponents,
pub fn program_from_shape( &self, shape: SP1CompressProgramShape, shrink_shape: Option<RecursionShape>, ) -> Arc<RecursionProgram<BabyBear>>
Source§impl<C> SP1Prover<C>where
C: SP1ProverComponents,
impl<C> SP1Prover<C>where
C: SP1ProverComponents,
Sourcepub fn verify(
&self,
proof: &SP1CoreProofData,
vk: &SP1VerifyingKey,
) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
pub fn verify( &self, proof: &SP1CoreProofData, vk: &SP1VerifyingKey, ) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
Verify a core proof by verifying the shards, verifying lookup bus, verifying that the shards are contiguous and complete.
Sourcepub fn verify_compressed(
&self,
proof: &SP1ReduceProof<BabyBearPoseidon2>,
vk: &SP1VerifyingKey,
) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
pub fn verify_compressed( &self, proof: &SP1ReduceProof<BabyBearPoseidon2>, vk: &SP1VerifyingKey, ) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
Verify a compressed proof.
Sourcepub fn verify_shrink(
&self,
proof: &SP1ReduceProof<BabyBearPoseidon2>,
vk: &SP1VerifyingKey,
) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
pub fn verify_shrink( &self, proof: &SP1ReduceProof<BabyBearPoseidon2>, vk: &SP1VerifyingKey, ) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
Verify a shrink proof.
Sourcepub fn verify_wrap_bn254(
&self,
proof: &SP1ReduceProof<BabyBearPoseidon2Outer>,
vk: &SP1VerifyingKey,
) -> Result<(), MachineVerificationError<BabyBearPoseidon2Outer>>
pub fn verify_wrap_bn254( &self, proof: &SP1ReduceProof<BabyBearPoseidon2Outer>, vk: &SP1VerifyingKey, ) -> Result<(), MachineVerificationError<BabyBearPoseidon2Outer>>
Verify a wrap bn254 proof.
Sourcepub fn verify_plonk_bn254(
&self,
proof: &PlonkBn254Proof,
vk: &SP1VerifyingKey,
public_values: &SP1PublicValues,
build_dir: &Path,
) -> Result<(), Error>
pub fn verify_plonk_bn254( &self, proof: &PlonkBn254Proof, vk: &SP1VerifyingKey, public_values: &SP1PublicValues, build_dir: &Path, ) -> Result<(), Error>
Verifies a PLONK proof using the circuit artifacts in the build directory.
Sourcepub fn verify_groth16_bn254(
&self,
proof: &Groth16Bn254Proof,
vk: &SP1VerifyingKey,
public_values: &SP1PublicValues,
build_dir: &Path,
) -> Result<(), Error>
pub fn verify_groth16_bn254( &self, proof: &Groth16Bn254Proof, vk: &SP1VerifyingKey, public_values: &SP1PublicValues, build_dir: &Path, ) -> Result<(), Error>
Verifies a Groth16 proof using the circuit artifacts in the build directory.
Source§impl<C> SP1Prover<C>where
C: SP1ProverComponents,
impl<C> SP1Prover<C>where
C: SP1ProverComponents,
Sourcepub fn uninitialized() -> SP1Prover<C>
pub fn uninitialized() -> SP1Prover<C>
Creates a new SP1Prover with lazily initialized components.
Sourcepub fn setup(
&self,
elf: &[u8],
) -> (SP1ProvingKey, <<C as SP1ProverComponents>::CoreProver as MachineProver<BabyBearPoseidon2, RiscvAir<BabyBear>>>::DeviceProvingKey, Program, SP1VerifyingKey)
pub fn setup( &self, elf: &[u8], ) -> (SP1ProvingKey, <<C as SP1ProverComponents>::CoreProver as MachineProver<BabyBearPoseidon2, RiscvAir<BabyBear>>>::DeviceProvingKey, Program, SP1VerifyingKey)
Creates a proving key and a verifying key for a given RISC-V ELF.
Sourcepub fn get_program(&self, elf: &[u8]) -> Result<Program, Report>
pub fn get_program(&self, elf: &[u8]) -> Result<Program, Report>
Get a program with an allowed preprocessed shape.
Sourcepub fn execute<'a>(
&'a self,
elf: &[u8],
stdin: &SP1Stdin,
context: SP1Context<'a>,
) -> Result<(SP1PublicValues, [u8; 32], ExecutionReport), ExecutionError>
pub fn execute<'a>( &'a self, elf: &[u8], stdin: &SP1Stdin, context: SP1Context<'a>, ) -> Result<(SP1PublicValues, [u8; 32], ExecutionReport), ExecutionError>
Execute an SP1 program with the specified inputs.
Sourcepub fn prove_core<'a>(
&'a self,
pk_d: &<<C as SP1ProverComponents>::CoreProver as MachineProver<BabyBearPoseidon2, RiscvAir<BabyBear>>>::DeviceProvingKey,
program: Program,
stdin: &SP1Stdin,
opts: SP1ProverOpts,
context: SP1Context<'a>,
) -> Result<SP1ProofWithMetadata<SP1CoreProofData>, SP1CoreProverError>
pub fn prove_core<'a>( &'a self, pk_d: &<<C as SP1ProverComponents>::CoreProver as MachineProver<BabyBearPoseidon2, RiscvAir<BabyBear>>>::DeviceProvingKey, program: Program, stdin: &SP1Stdin, opts: SP1ProverOpts, context: SP1Context<'a>, ) -> Result<SP1ProofWithMetadata<SP1CoreProofData>, SP1CoreProverError>
Generate shard proofs which split up and prove the valid execution of a RISC-V program with the core prover. Uses the provided context.
Sourcepub fn compress(
&self,
vk: &SP1VerifyingKey,
proof: SP1ProofWithMetadata<SP1CoreProofData>,
deferred_proofs: Vec<SP1ReduceProof<BabyBearPoseidon2>>,
opts: SP1ProverOpts,
) -> Result<SP1ReduceProof<BabyBearPoseidon2>, SP1RecursionProverError>
pub fn compress( &self, vk: &SP1VerifyingKey, proof: SP1ProofWithMetadata<SP1CoreProofData>, deferred_proofs: Vec<SP1ReduceProof<BabyBearPoseidon2>>, opts: SP1ProverOpts, ) -> Result<SP1ReduceProof<BabyBearPoseidon2>, SP1RecursionProverError>
Reduce shards proofs to a single shard proof using the recursion prover.
Sourcepub fn shrink(
&self,
reduced_proof: SP1ReduceProof<BabyBearPoseidon2>,
opts: SP1ProverOpts,
) -> Result<SP1ReduceProof<BabyBearPoseidon2>, SP1RecursionProverError>
pub fn shrink( &self, reduced_proof: SP1ReduceProof<BabyBearPoseidon2>, opts: SP1ProverOpts, ) -> Result<SP1ReduceProof<BabyBearPoseidon2>, SP1RecursionProverError>
Wrap a reduce proof into a STARK proven over a SNARK-friendly field.
Sourcepub fn wrap_bn254(
&self,
compressed_proof: SP1ReduceProof<BabyBearPoseidon2>,
opts: SP1ProverOpts,
) -> Result<SP1ReduceProof<BabyBearPoseidon2Outer>, SP1RecursionProverError>
pub fn wrap_bn254( &self, compressed_proof: SP1ReduceProof<BabyBearPoseidon2>, opts: SP1ProverOpts, ) -> Result<SP1ReduceProof<BabyBearPoseidon2Outer>, SP1RecursionProverError>
Wrap a reduce proof into a STARK proven over a SNARK-friendly field.
Sourcepub fn wrap_plonk_bn254(
&self,
proof: SP1ReduceProof<BabyBearPoseidon2Outer>,
build_dir: &Path,
) -> PlonkBn254Proof
pub fn wrap_plonk_bn254( &self, proof: SP1ReduceProof<BabyBearPoseidon2Outer>, build_dir: &Path, ) -> PlonkBn254Proof
Wrap the STARK proven over a SNARK-friendly field into a PLONK proof.
Sourcepub fn wrap_groth16_bn254(
&self,
proof: SP1ReduceProof<BabyBearPoseidon2Outer>,
build_dir: &Path,
) -> Groth16Bn254Proof
pub fn wrap_groth16_bn254( &self, proof: SP1ReduceProof<BabyBearPoseidon2Outer>, build_dir: &Path, ) -> Groth16Bn254Proof
Wrap the STARK proven over a SNARK-friendly field into a Groth16 proof.
pub fn recursion_program( &self, input: &SP1RecursionWitnessValues<BabyBearPoseidon2>, ) -> Arc<RecursionProgram<BabyBear>>
pub fn compress_program( &self, input: &SP1CompressWithVKeyWitnessValues<BabyBearPoseidon2>, ) -> Arc<RecursionProgram<BabyBear>>
pub fn shrink_program( &self, shrink_shape: RecursionShape, input: &SP1CompressWithVKeyWitnessValues<BabyBearPoseidon2>, ) -> Arc<RecursionProgram<BabyBear>>
pub fn wrap_program(&self) -> Arc<RecursionProgram<BabyBear>>
pub fn deferred_program( &self, input: &SP1DeferredWitnessValues<BabyBearPoseidon2>, ) -> Arc<RecursionProgram<BabyBear>>
pub fn get_recursion_core_inputs( &self, vk: &StarkVerifyingKey<BabyBearPoseidon2>, shard_proofs: &[ShardProof<BabyBearPoseidon2>], batch_size: usize, is_complete: bool, deferred_digest: [<<<BabyBearPoseidon2 as StarkGenericConfig>::Pcs as Pcs<<BabyBearPoseidon2 as StarkGenericConfig>::Challenge, <BabyBearPoseidon2 as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val; 8], ) -> Vec<SP1RecursionWitnessValues<BabyBearPoseidon2>>
pub fn get_recursion_deferred_inputs_with_initial_digest<'a>( &'a self, vk: &'a StarkVerifyingKey<BabyBearPoseidon2>, deferred_proofs: &[SP1ReduceProof<BabyBearPoseidon2>], deferred_digest: [<<<BabyBearPoseidon2 as StarkGenericConfig>::Pcs as Pcs<<BabyBearPoseidon2 as StarkGenericConfig>::Challenge, <BabyBearPoseidon2 as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val; 8], batch_size: usize, ) -> (Vec<SP1DeferredWitnessValues<BabyBearPoseidon2>>, [BabyBear; 8])
pub fn get_recursion_deferred_inputs<'a>( &'a self, vk: &'a StarkVerifyingKey<BabyBearPoseidon2>, deferred_proofs: &[SP1ReduceProof<BabyBearPoseidon2>], batch_size: usize, ) -> (Vec<SP1DeferredWitnessValues<BabyBearPoseidon2>>, [BabyBear; 8])
Sourcepub fn get_first_layer_inputs<'a>(
&'a self,
vk: &'a SP1VerifyingKey,
shard_proofs: &[ShardProof<BabyBearPoseidon2>],
deferred_proofs: &[SP1ReduceProof<BabyBearPoseidon2>],
batch_size: usize,
) -> Vec<SP1CircuitWitness>
pub fn get_first_layer_inputs<'a>( &'a self, vk: &'a SP1VerifyingKey, shard_proofs: &[ShardProof<BabyBearPoseidon2>], deferred_proofs: &[SP1ReduceProof<BabyBearPoseidon2>], batch_size: usize, ) -> Vec<SP1CircuitWitness>
Generate the inputs for the first layer of recursive proofs.
Sourcepub fn hash_deferred_proofs(
prev_digest: [<<<BabyBearPoseidon2 as StarkGenericConfig>::Pcs as Pcs<<BabyBearPoseidon2 as StarkGenericConfig>::Challenge, <BabyBearPoseidon2 as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val; 8],
deferred_proofs: &[SP1ReduceProof<BabyBearPoseidon2>],
) -> [<<<BabyBearPoseidon2 as StarkGenericConfig>::Pcs as Pcs<<BabyBearPoseidon2 as StarkGenericConfig>::Challenge, <BabyBearPoseidon2 as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val; 8]
pub fn hash_deferred_proofs( prev_digest: [<<<BabyBearPoseidon2 as StarkGenericConfig>::Pcs as Pcs<<BabyBearPoseidon2 as StarkGenericConfig>::Challenge, <BabyBearPoseidon2 as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val; 8], deferred_proofs: &[SP1ReduceProof<BabyBearPoseidon2>], ) -> [<<<BabyBearPoseidon2 as StarkGenericConfig>::Pcs as Pcs<<BabyBearPoseidon2 as StarkGenericConfig>::Challenge, <BabyBearPoseidon2 as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val; 8]
Accumulate deferred proofs into a single digest.
pub fn make_merkle_proofs( &self, input: SP1CompressWitnessValues<BabyBearPoseidon2>, ) -> SP1CompressWithVKeyWitnessValues<BabyBearPoseidon2>
Trait Implementations§
Source§impl<C> SubproofVerifier for SP1Prover<C>where
C: SP1ProverComponents,
impl<C> SubproofVerifier for SP1Prover<C>where
C: SP1ProverComponents,
Source§fn verify_deferred_proof(
&self,
proof: &SP1ReduceProof<BabyBearPoseidon2>,
vk: &StarkVerifyingKey<BabyBearPoseidon2>,
vk_hash: [u32; 8],
committed_value_digest: [u32; 8],
) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
fn verify_deferred_proof( &self, proof: &SP1ReduceProof<BabyBearPoseidon2>, vk: &StarkVerifyingKey<BabyBearPoseidon2>, vk_hash: [u32; 8], committed_value_digest: [u32; 8], ) -> Result<(), MachineVerificationError<BabyBearPoseidon2>>
Auto Trait Implementations§
impl<C = CpuProverComponents> !Freeze for SP1Prover<C>
impl<C> RefUnwindSafe for SP1Prover<C>where
<C as SP1ProverComponents>::CoreProver: RefUnwindSafe,
<C as SP1ProverComponents>::CompressProver: RefUnwindSafe,
<C as SP1ProverComponents>::ShrinkProver: RefUnwindSafe,
<C as SP1ProverComponents>::WrapProver: RefUnwindSafe,
impl<C> Send for SP1Prover<C>
impl<C> Sync for SP1Prover<C>
impl<C> Unpin for SP1Prover<C>where
<C as SP1ProverComponents>::CoreProver: Unpin,
<C as SP1ProverComponents>::CompressProver: Unpin,
<C as SP1ProverComponents>::ShrinkProver: Unpin,
<C as SP1ProverComponents>::WrapProver: Unpin,
impl<C> UnwindSafe for SP1Prover<C>where
<C as SP1ProverComponents>::CoreProver: UnwindSafe,
<C as SP1ProverComponents>::CompressProver: UnwindSafe,
<C as SP1ProverComponents>::ShrinkProver: UnwindSafe,
<C as SP1ProverComponents>::WrapProver: UnwindSafe,
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> 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>
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>
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)
&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)
&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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<F, EF, E> ExtensionOperand<F, EF> for E
impl<F, EF, E> ExtensionOperand<F, EF> for E
fn to_operand(self) -> ExtOperand<F, EF>
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.