[][src]Struct sequoia_openpgp::tpk::TPKValidator

pub struct TPKValidator(_);

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

Implementations

impl TPKValidator[src]

pub fn new() -> Self[src]

Instantiates a new TPKValidator.

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

Returns whether the packet sequence is a valid TPK.

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

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

Returns whether the packet sequence forms a valid TPK prefix.

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

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

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

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 TPKValidity::TPKPrefix.

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

Returns whether the token stream corresponds to a valid TPK.

This returns a tri-state: if the packet sequence is a valid TPK, it returns TPKValidity::TPK, if the packet sequence is invalid, then it returns TPKValidity::Error. If the packet sequence could be valid, then it returns TPKValidity::TPKPrefix.

Note: if TPKValidator::finish() hasn't been called, then this function will only ever return either TPKValidity::TPKPrefix or TPKValidity::Error. Once TPKValidity::finish() has been called, then only TPKValidity::TPK or TPKValidity::Bad will be called.

Trait Implementations

impl Debug for TPKValidator[src]

impl Default for TPKValidator[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>,