pub enum ExcData {
None,
Unicode(Box<UnicodeErrorData>),
Json(Box<JsonErrorData>),
}Expand description
Structured payload attached to exception types whose CPython counterparts
carry more than a message. Currently unicode and json decode errors have
one; the enum leaves room for future variants (e.g. OSError’s
errno/filename) without another field on every exception.
Variants§
None
No structured payload — every exception type without a variant below.
Unicode(Box<UnicodeErrorData>)
UnicodeDecodeError / UnicodeEncodeError constructor fields.
Boxed to keep the common None case (and every exception embedding
this enum) small.
Json(Box<JsonErrorData>)
json.JSONDecodeError attribute fields. Boxed like
ExcData::Unicode to keep the enum small.
Implementations§
Source§impl ExcData
impl ExcData
Sourcepub fn unicode(&self) -> Option<&UnicodeErrorData>
pub fn unicode(&self) -> Option<&UnicodeErrorData>
The unicode-error fields, if this is ExcData::Unicode.
Sourcepub fn json(&self) -> Option<&JsonErrorData>
pub fn json(&self) -> Option<&JsonErrorData>
The json-error fields, if this is ExcData::Json.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ExcData
impl<'de> Deserialize<'de> for ExcData
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ExcData
Auto Trait Implementations§
impl Freeze for ExcData
impl RefUnwindSafe for ExcData
impl Send for ExcData
impl Sync for ExcData
impl Unpin for ExcData
impl UnsafeUnpin for ExcData
impl UnwindSafe for ExcData
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