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

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

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)

An error with data.

FrontSide(FrontSide)

An error with a front side.

ReverseSide(ReverseSide)

An error with a reverse side.

Selfie(Selfie)

An error with a selfie.

File(File)

An error with a file.

Files(Files)

An error with several files.

TranslationFile(TranslationFile)

An error with a translation file.

TranslationFiles(TranslationFiles)

An error with translation files.

Unspecified(Unspecified)

An unspecified error.

Implementations

impl Source[src]

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

Returns true if self is of variant Data.

pub fn expect_data(self) -> Data 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>[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 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>[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 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>[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 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>[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 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>[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 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>[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 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>[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 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>[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 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>[src]

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

Trait Implementations

impl Clone for Source[src]

impl Debug for Source[src]

impl From<Data> for Source[src]

impl From<File> for Source[src]

impl From<Files> for Source[src]

impl From<FrontSide> for Source[src]

impl From<ReverseSide> for Source[src]

impl From<Selfie> for Source[src]

impl From<TranslationFile> for Source[src]

impl From<TranslationFiles> for Source[src]

impl From<Unspecified> for Source[src]

impl Hash for Source[src]

impl PartialEq<Source> for Source[src]

impl Serialize for Source[src]

impl Eq for Source[src]

impl StructuralEq for Source[src]

impl StructuralPartialEq for Source[src]

Auto Trait Implementations

impl RefUnwindSafe for Source

impl Send for Source

impl Sync for Source

impl Unpin for Source

impl UnwindSafe for Source

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.