[][src]Struct sequoia_openpgp::tpk::KeyringValidator

pub struct KeyringValidator { /* fields omitted */ }

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

Methods

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]

Note 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 could be valid, 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 only KeyringValidity::Keyring or KeyringValidity::Bad will be called.

Trait Implementations

impl Default for KeyringValidator[src]

impl Debug for KeyringValidator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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 for T where
    V: MultiLane<T>,