pub enum MRZError {
InvalidMRZInput,
InvalidDocumentNumber,
InvalidBirthDate,
InvalidExpiryDate,
InvalidOptionalData,
InvalidMRZValue,
Custom(String),
}Expand description
Error types produced by the MRZ parser.
Variants§
InvalidMRZInput
Invalid MRZ parser input
InvalidDocumentNumber
Document number hash mismatch
InvalidBirthDate
Birth date hash mismatch
InvalidExpiryDate
Expiry date hash mismatch
InvalidOptionalData
Optional data hash mismatch
InvalidMRZValue
Final hash mismatch
Custom(String)
A generic/custom error with a message.
Implementations§
Source§impl MRZError
impl MRZError
Sourcepub fn invalid_mrz_input() -> Self
pub fn invalid_mrz_input() -> Self
Convenience constructors for each variant.
pub fn invalid_document_number() -> Self
pub fn invalid_birth_date() -> Self
pub fn invalid_expiry_date() -> Self
pub fn invalid_optional_data() -> Self
pub fn invalid_mrz_value() -> Self
Trait Implementations§
impl Eq for MRZError
Source§impl Error for MRZError
impl Error for MRZError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for MRZError
Auto Trait Implementations§
impl Freeze for MRZError
impl RefUnwindSafe for MRZError
impl Send for MRZError
impl Sync for MRZError
impl Unpin for MRZError
impl UnsafeUnpin for MRZError
impl UnwindSafe for MRZError
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
Mutably borrows from an owned value. Read more