Skip to main content

NetdocUnverified

Trait NetdocUnverified 

Source
pub trait NetdocUnverified: Sized {
    type Body: Sized;
    type Signatures: NetdocParseableSignatures;

    // Required methods
    fn inspect_unverified(&self) -> (&Self::Body, &SignaturesData<Self>);
    fn unwrap_unverified(self) -> (Self::Body, SignaturesData<Self>);
    fn from_parts(body: Self::Body, signatures: SignaturesData<Self>) -> Self;
}
Expand description

A network document with (unverified) signatures

Typically implemented automatically, for FooUnverified structs, as defined by #[derive_deftly(NetdocParseableUnverified)].

Each FooUnverified embodies precisely the body Body and the signatures data SignaturesData needed to verify it, This trait is precisely the constructors/accessors/deconstructors.

Required Associated Types§

Source

type Body: Sized

The body, ie not including the signatures

Source

type Signatures: NetdocParseableSignatures

The signatures (the whole signature section)

Required Methods§

Source

fn inspect_unverified(&self) -> (&Self::Body, &SignaturesData<Self>)

Inspect the document (and its signatures)

§Security hazard

The signature has not been verified, so the returned data must not be trusted.

Source

fn unwrap_unverified(self) -> (Self::Body, SignaturesData<Self>)

Obtain the actual document (and signatures), without verifying

§Security hazard

The signature has not been verified, so the returned data must not be trusted.

Source

fn from_parts(body: Self::Body, signatures: SignaturesData<Self>) -> Self

Construct a new NetdocUnverified from a body and signatures

(Called by code generated by #[derive_deftly(NetdocUnverified)].)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§