pub enum BRCodeError {
Show 14 variants
InvalidFormat(String),
MissingField(String),
InvalidFieldLength {
tag: String,
expected: usize,
actual: usize,
},
InvalidFieldValue {
tag: String,
value: String,
},
InvalidChecksum,
InvalidPixKey(String),
InvalidGui(String),
InvalidCurrency(String),
InvalidCountryCode(String),
InvalidPayloadFormat(String),
FieldTooLong {
tag: String,
max_length: usize,
actual_length: usize,
},
ParseNumericError(String),
UnsupportedFeature(String),
TlvParsingError(String),
}
Expand description
Errors that can occur during BR Code parsing and validation
Variants§
InvalidFormat(String)
Invalid or malformed QR code format
MissingField(String)
Missing required field
InvalidFieldLength
Invalid field length
InvalidFieldValue
Invalid field value
InvalidChecksum
CRC16 checksum validation failed
InvalidPixKey(String)
Invalid PIX key format
InvalidGui(String)
Invalid GUI (should be “br.gov.bcb.pix”)
InvalidCurrency(String)
Invalid currency code (should be “986” for BRL)
InvalidCountryCode(String)
Invalid country code (should be “BR”)
InvalidPayloadFormat(String)
Invalid payload format indicator
FieldTooLong
Field value too long
ParseNumericError(String)
Parsing error for numeric fields
UnsupportedFeature(String)
Unsupported QR code version or features
TlvParsingError(String)
TLV parsing error
Implementations§
Source§impl BRCodeError
impl BRCodeError
Sourcepub fn invalid_format<T: Into<String>>(msg: T) -> Self
pub fn invalid_format<T: Into<String>>(msg: T) -> Self
Create a new invalid format error
Sourcepub fn missing_field<T: Into<String>>(field: T) -> Self
pub fn missing_field<T: Into<String>>(field: T) -> Self
Create a new missing field error
Trait Implementations§
Source§impl Debug for BRCodeError
impl Debug for BRCodeError
Source§impl Display for BRCodeError
impl Display for BRCodeError
Source§impl Error for BRCodeError
impl Error for BRCodeError
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()
Source§impl PartialEq for BRCodeError
impl PartialEq for BRCodeError
impl StructuralPartialEq for BRCodeError
Auto Trait Implementations§
impl Freeze for BRCodeError
impl RefUnwindSafe for BRCodeError
impl Send for BRCodeError
impl Sync for BRCodeError
impl Unpin for BRCodeError
impl UnwindSafe for BRCodeError
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