Struct tgbot::types::PassportElementError
source · pub struct PassportElementError { /* private fields */ }
Expand description
Represents an error in the Telegram Passport element which was submitted that should be resolved by a user.
Implementations§
source§impl PassportElementError
impl PassportElementError
sourcepub fn data_field<A, B, C>(
element_type: EncryptedPassportElementType,
field_name: A,
data_hash: B,
message: C
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn data_field<A, B, C>( element_type: EncryptedPassportElementType, field_name: A, data_hash: B, message: C ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue in one of a data fields that was provided by a user. The error is considered resolved when the field’s value changes.
§Arguments
element_type
- A section of the user’s Telegram Passport which has the error.field_name
- A name of a data field which has the error.data_hash
- A base64-encoded data hash.message
- An error message.
Supported element types:
sourcepub fn front_side<A, B>(
element_type: EncryptedPassportElementType,
file_hash: A,
message: B
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn front_side<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with the front side of a document. The error is considered resolved when a file with the front side of the document changes.
§Arguments
element_type
- A section of a user’s Telegram Passport which has the error.file_hash
- A base64-encoded hash of the file with the front side of the document.message
- An error message.
Supported element types:
sourcepub fn reverse_side<A, B>(
element_type: EncryptedPassportElementType,
file_hash: A,
message: B
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn reverse_side<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with the reverse side of a document. The error is considered resolved when a file with reverse side of the document changes.
§Arguments
element_type
- A section of the user’s Telegram Passport which has the error.file_hash
- A base64-encoded hash of the file with the reverse side of the document.message
- An error message.
Supported element types:
sourcepub fn selfie<A, B>(
element_type: EncryptedPassportElementType,
file_hash: A,
message: B
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn selfie<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with the selfie with a document. The error is considered resolved when a file with the selfie changes.
§Arguments
element_type
- A section of the user’s Telegram Passport which has the error.file_hash
- A base64-encoded hash of the file with the selfie.message
- An error message.
Supported element types:
sourcepub fn file<A, B>(
element_type: EncryptedPassportElementType,
file_hash: A,
message: B
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn file<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with a document scan. The error is considered resolved when a file with the document scan changes.
§Arguments
element_type
- The section of the user’s Telegram Passport which has the error.file_hash
- A base64-encoded hash of the file with the selfie.message
- An error message.
Supported element types:
sourcepub fn files<A, B, C>(
element_type: EncryptedPassportElementType,
file_hashes: A,
message: C
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn files<A, B, C>( element_type: EncryptedPassportElementType, file_hashes: A, message: C ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with a list of scans. The error is considered resolved when a list of files containing the scans changes.
§Arguments
element_type
- A section of the user’s Telegram Passport which has the error.file_hashes
- A list of base64-encoded file hashes.message
- An error message.
Supported element types:
sourcepub fn translation_file<A, B>(
element_type: EncryptedPassportElementType,
file_hash: A,
message: B
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn translation_file<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when a file changes.
§Arguments
element_type
- A type of element of the user’s Telegram Passport which has the error.file_hash
- A base64-encoded hash of the file with the selfie.message
- An error message.
Supported element types:
EncryptedPassportElementType::BankStatement
EncryptedPassportElementType::DriverLicense
EncryptedPassportElementType::IdentityCard
EncryptedPassportElementType::InternalPassport
EncryptedPassportElementType::Passport
EncryptedPassportElementType::PassportRegistration
EncryptedPassportElementType::RentalAgreement
EncryptedPassportElementType::TemporaryRegistration
EncryptedPassportElementType::UtilityBill
sourcepub fn translation_files<A, B, C>(
element_type: EncryptedPassportElementType,
file_hashes: A,
message: C
) -> Result<Self, UnexpectedEncryptedPassportElementType>
pub fn translation_files<A, B, C>( element_type: EncryptedPassportElementType, file_hashes: A, message: C ) -> Result<Self, UnexpectedEncryptedPassportElementType>
Creates a new PassportElementError
.
Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes.
§Arguments
element_type
- A type of element of the user’s Telegram Passport which has the error.file_hashes
- A list of base64-encoded file hashes.message
- An error message.
Supported element types:
EncryptedPassportElementType::BankStatement
EncryptedPassportElementType::DriverLicense
EncryptedPassportElementType::IdentityCard
EncryptedPassportElementType::InternalPassport
EncryptedPassportElementType::Passport
EncryptedPassportElementType::PassportRegistration
EncryptedPassportElementType::RentalAgreement
EncryptedPassportElementType::TemporaryRegistration
EncryptedPassportElementType::UtilityBill
sourcepub fn unspecified<A, B>(
element_type: EncryptedPassportElementType,
element_hash: A,
message: B
) -> Self
pub fn unspecified<A, B>( element_type: EncryptedPassportElementType, element_hash: A, message: B ) -> Self
Creates a new PassportElementError
.
Represents an issue in an unspecified place. The error is considered resolved when new data is added.
§Arguments
element_type
- A type of element of the user’s Telegram Passport which has the error.element_hash
- A base64-encoded element hash.message
- An error message.
Accepts any variant of EncryptedPassportElementType
.
Trait Implementations§
source§impl Clone for PassportElementError
impl Clone for PassportElementError
source§fn clone(&self) -> PassportElementError
fn clone(&self) -> PassportElementError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PassportElementError
impl Debug for PassportElementError
source§impl<'de> Deserialize<'de> for PassportElementError
impl<'de> Deserialize<'de> for PassportElementError
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for PassportElementError
impl PartialEq for PassportElementError
source§fn eq(&self, other: &PassportElementError) -> bool
fn eq(&self, other: &PassportElementError) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for PassportElementError
impl PartialOrd for PassportElementError
source§fn partial_cmp(&self, other: &PassportElementError) -> Option<Ordering>
fn partial_cmp(&self, other: &PassportElementError) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more