[][src]Struct sequoia_openpgp::cert::KeyringValidator

pub struct KeyringValidator { /* fields omitted */ }

Used to help validate that a packet sequence is a valid key ring.

Implementations

impl KeyringValidator[src]

pub fn new() -> Self[src]

Instantiates a new KeyringValidator.

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

Returns whether the packet sequence is a valid keyring.

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

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

Returns whether the packet sequence forms a valid keyring prefix.

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

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

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

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]

Notes that the entire message has been seen.

This function may only be called once.

Once called, this function will no longer return KeyringValidity::KeyringPrefix.

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

Returns whether the token stream corresponds to a valid keyring.

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

Note: if KeyringValidator::finish() hasn't been called, then this function will only ever return either KeyringValidity::KeyringPrefix or KeyringValidity::Error. Once KeyringValidity::finish() has been called, then it will only return either KeyringValidity::Keyring or KeyringValidity::Error.

Trait Implementations

impl Debug for KeyringValidator[src]

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