Struct carapax::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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn data_field<A, B, C>( element_type: EncryptedPassportElementType, field_name: A, data_hash: B, message: C ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn front_side<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn reverse_side<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn selfie<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn file<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn files<A, B, C>( element_type: EncryptedPassportElementType, file_hashes: A, message: C ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn translation_file<A, B>( element_type: EncryptedPassportElementType, file_hash: A, message: B ) -> Result<PassportElementError, 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<PassportElementError, UnexpectedEncryptedPassportElementType>
pub fn translation_files<A, B, C>( element_type: EncryptedPassportElementType, file_hashes: A, message: C ) -> Result<PassportElementError, 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
) -> PassportElementError
pub fn unspecified<A, B>( element_type: EncryptedPassportElementType, element_hash: A, message: B ) -> PassportElementError
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<PassportElementError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<PassportElementError, <__D as Deserializer<'de>>::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 moresource§impl Serialize for PassportElementError
impl Serialize for PassportElementError
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for PassportElementError
Auto Trait Implementations§
impl Freeze for PassportElementError
impl RefUnwindSafe for PassportElementError
impl Send for PassportElementError
impl Sync for PassportElementError
impl Unpin for PassportElementError
impl UnwindSafe for PassportElementError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more