pub struct PythonException {
pub class: String,
pub message: String,
pub cause: Option<Box<PythonException>>,
pub context: Option<Box<PythonException>>,
pub suppress_context: bool,
}Expand description
A checked Python exception with explicit chaining fields.
Fields§
§class: StringException class name.
message: StringException message.
cause: Option<Box<PythonException>>Explicit raise ... from ... cause.
context: Option<Box<PythonException>>Implicit active-exception context.
suppress_context: boolWhether implicit context display is suppressed.
Implementations§
Source§impl PythonException
impl PythonException
Sourcepub fn new(class: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(class: impl Into<String>, message: impl Into<String>) -> Self
Construct an unchained exception.
Sourcepub fn with_cause(self, cause: PythonException) -> Self
pub fn with_cause(self, cause: PythonException) -> Self
Attach an explicit cause, suppressing implicit context display.
Sourcepub fn with_context(self, context: PythonException) -> Self
pub fn with_context(self, context: PythonException) -> Self
Attach the exception active while this exception was raised.
Trait Implementations§
Source§impl Clone for PythonException
impl Clone for PythonException
Source§fn clone(&self) -> PythonException
fn clone(&self) -> PythonException
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PythonException
impl Debug for PythonException
impl Eq for PythonException
Source§impl PartialEq for PythonException
impl PartialEq for PythonException
impl StructuralPartialEq for PythonException
Auto Trait Implementations§
impl Freeze for PythonException
impl RefUnwindSafe for PythonException
impl Send for PythonException
impl Sync for PythonException
impl Unpin for PythonException
impl UnsafeUnpin for PythonException
impl UnwindSafe for PythonException
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.