[][src]Enum tbot::types::passport::element::error::Source

#[non_exhaustive]#[must_use]pub enum Source<'a> {
    Data(Data<'a>),
    FrontSide(FrontSide<'a>),
    ReverseSide(ReverseSide<'a>),
    Selfie(Selfie<'a>),
    File(File<'a>),
    Files(Files<'a>),
    TranslationFile(TranslationFile<'a>),
    TranslationFiles(TranslationFiles<'a>),
    Unspecified(Unspecified<'a>),
}

Reperesents possible sources of an error.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Data(Data<'a>)

An error with data.

FrontSide(FrontSide<'a>)

An error with a front side.

ReverseSide(ReverseSide<'a>)

An error with a reverse side.

Selfie(Selfie<'a>)

An error with a selfie.

File(File<'a>)

An error with a file.

Files(Files<'a>)

An error with several files.

TranslationFile(TranslationFile<'a>)

An error with a translation file.

TranslationFiles(TranslationFiles<'a>)

An error with translation files.

Unspecified(Unspecified<'a>)

An unspecified error.

Implementations

impl<'a> Source<'a>[src]

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

Returns true if self is of variant Data.

pub fn expect_data(self) -> Data<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Data.

Panics

Panics if the value is not Data, with a panic message including the content of self.

pub fn data(self) -> Option<Data<'a>>[src]

Returns Some if self is of variant Data, and None otherwise.

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

Returns true if self is of variant FrontSide.

pub fn expect_front_side(self) -> FrontSide<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of FrontSide.

Panics

Panics if the value is not FrontSide, with a panic message including the content of self.

pub fn front_side(self) -> Option<FrontSide<'a>>[src]

Returns Some if self is of variant FrontSide, and None otherwise.

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

Returns true if self is of variant ReverseSide.

pub fn expect_reverse_side(self) -> ReverseSide<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of ReverseSide.

Panics

Panics if the value is not ReverseSide, with a panic message including the content of self.

pub fn reverse_side(self) -> Option<ReverseSide<'a>>[src]

Returns Some if self is of variant ReverseSide, and None otherwise.

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

Returns true if self is of variant Selfie.

pub fn expect_selfie(self) -> Selfie<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Selfie.

Panics

Panics if the value is not Selfie, with a panic message including the content of self.

pub fn selfie(self) -> Option<Selfie<'a>>[src]

Returns Some if self is of variant Selfie, and None otherwise.

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

Returns true if self is of variant File.

pub fn expect_file(self) -> File<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of File.

Panics

Panics if the value is not File, with a panic message including the content of self.

pub fn file(self) -> Option<File<'a>>[src]

Returns Some if self is of variant File, and None otherwise.

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

Returns true if self is of variant Files.

pub fn expect_files(self) -> Files<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Files.

Panics

Panics if the value is not Files, with a panic message including the content of self.

pub fn files(self) -> Option<Files<'a>>[src]

Returns Some if self is of variant Files, and None otherwise.

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

Returns true if self is of variant TranslationFile.

pub fn expect_translation_file(self) -> TranslationFile<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of TranslationFile.

Panics

Panics if the value is not TranslationFile, with a panic message including the content of self.

pub fn translation_file(self) -> Option<TranslationFile<'a>>[src]

Returns Some if self is of variant TranslationFile, and None otherwise.

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

Returns true if self is of variant TranslationFiles.

pub fn expect_translation_files(self) -> TranslationFiles<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of TranslationFiles.

Panics

Panics if the value is not TranslationFiles, with a panic message including the content of self.

pub fn translation_files(self) -> Option<TranslationFiles<'a>>[src]

Returns Some if self is of variant TranslationFiles, and None otherwise.

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

Returns true if self is of variant Unspecified.

pub fn expect_unspecified(self) -> Unspecified<'a> where
    Self: Debug
[src]

Unwraps the value, yielding the content of Unspecified.

Panics

Panics if the value is not Unspecified, with a panic message including the content of self.

pub fn unspecified(self) -> Option<Unspecified<'a>>[src]

Returns Some if self is of variant Unspecified, and None otherwise.

Trait Implementations

impl<'a> Clone for Source<'a>[src]

impl<'a> Copy for Source<'a>[src]

impl<'a> Debug for Source<'a>[src]

impl<'a> Eq for Source<'a>[src]

impl<'a> From<Data<'a>> for Source<'a>[src]

impl<'a> From<File<'a>> for Source<'a>[src]

impl<'a> From<Files<'a>> for Source<'a>[src]

impl<'a> From<FrontSide<'a>> for Source<'a>[src]

impl<'a> From<ReverseSide<'a>> for Source<'a>[src]

impl<'a> From<Selfie<'a>> for Source<'a>[src]

impl<'a> From<TranslationFile<'a>> for Source<'a>[src]

impl<'a> From<TranslationFiles<'a>> for Source<'a>[src]

impl<'a> From<Unspecified<'a>> for Source<'a>[src]

impl<'a> Hash for Source<'a>[src]

impl<'a> PartialEq<Source<'a>> for Source<'a>[src]

impl<'a> Serialize for Source<'a>[src]

impl<'a> StructuralEq for Source<'a>[src]

impl<'a> StructuralPartialEq for Source<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Source<'a>

impl<'a> Send for Source<'a>

impl<'a> Sync for Source<'a>

impl<'a> Unpin for Source<'a>

impl<'a> UnwindSafe for Source<'a>

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<T> WithSubscriber for T[src]