Skip to main content

VerifyWith

Trait VerifyWith 

Source
pub trait VerifyWith<C>: Sized {
    type Verified;
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn verify_with(self, context: C) -> Result<Self::Verified, Self::Error>;
}
Expand description

Checks domain invariants using caller-supplied context and constructs the verified type.

Context can be borrowed, such as a trusted parent header, or owned, such as a security level. Use a named context struct when verification needs several inputs. Implementations must document any trust requirements on the context.

This capability is independent of Verify: implementing it does not provide context-free verification. Implementations are handwritten; decoding does not invoke verification. Boxes delegate to the contained verifier without cloning the context or changing its error. The collection field wrappers also implement this trait, retaining field, index, and key context as with Verify. For vectors and maps, context is cloned once per element; pass &context to share a context without cloning its contents.

Required Associated Types§

Source

type Verified

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn verify_with(self, context: C) -> Result<Self::Verified, Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S, C> VerifyWith<C> for Box<S>
where S: VerifyWith<C>,

Source§

type Verified = Box<<S as VerifyWith<C>>::Verified>

Source§

type Error = <S as VerifyWith<C>>::Error

Source§

fn verify_with( self, context: C, ) -> Result<<Box<S> as VerifyWith<C>>::Verified, <Box<S> as VerifyWith<C>>::Error>

Implementors§

Source§

impl VerifyWith<&BlockHeader> for SignedBlock

Authenticates the block against an already-trusted parent, in addition to self-consistency. This does not re-execute transactions or validate the account/nullifier state transition.

Source§

impl VerifyWith<&ProposedBatch> for ProvenBatch

Checks all fields duplicated from an already-verified proposal. The batch execution proof still needs verification by the consuming service; this only establishes proposal agreement.

Source§

impl VerifyWith<u32> for ProposedBatch

Verifies transaction proofs and batch consistency, not trust in the supplied reference chain.

Source§

impl<K, S, C> VerifyWith<C> for MapField<BTreeMap<K, S>>
where K: Ord + Debug, S: VerifyWith<C>, C: Clone,

Source§

impl<K, S, C> VerifyWith<C> for MapField<HashMap<K, S>>
where K: Eq + Hash + Debug, S: VerifyWith<C>, C: Clone,

Available on crate feature std only.
Source§

impl<S, C> VerifyWith<C> for OptionalField<S>
where S: VerifyWith<C>,

Source§

impl<S, C> VerifyWith<C> for RepeatedField<S>
where S: VerifyWith<C>, C: Clone,