[][src]Struct sequoia_openpgp::cert::CertValidator

pub struct CertValidator(_);

Used to help validate that a packet sequence is a valid Cert.

Methods

impl CertValidator[src]

pub fn new() -> Self[src]

Instantiates a new CertValidator.

pub fn is_cert(&self) -> bool[src]

Returns whether the packet sequence is a valid Cert.

Note: a CertValidator will only return this after CertValidator::finish has been called.

pub fn is_cert_prefix(&self) -> bool[src]

Returns whether the packet sequence forms a valid Cert prefix.

Note: a CertValidator will only return this before CertValidator::finish has been called.

pub fn is_err(&self) -> bool[src]

Returns whether the packet sequence is definitely not a valid Cert.

pub fn push_token(&mut self, token: Token)[src]

Add the token token to the token stream.

pub fn push(&mut self, tag: Tag)[src]

Add a packet of type tag to the token stream.

pub fn finish(&mut self)[src]

Note that the entire message has been seen.

This function may only be called once.

Once called, this function will no longer return CertValidity::CertPrefix.

pub fn check(&self) -> CertValidity[src]

Returns whether the token stream corresponds to a valid Cert.

This returns a tri-state: if the packet sequence is a valid Cert, it returns CertValidity::Cert, if the packet sequence is invalid, then it returns CertValidity::Error. If the packet sequence that has been processed so far is a valid prefix, then it returns CertValidity::CertPrefix.

Note: if CertValidator::finish() hasn't been called, then this function will only ever return either CertValidity::CertPrefix or CertValidity::Error. Once CertValidity::finish() has been called, then it will only return either CertValidity::Cert or CertValidity::Error.

Trait Implementations

impl Debug for CertValidator[src]

impl Default for CertValidator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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