Enum hwlocality::errors::HybridError
source · pub enum HybridError<RustError: Error> {
Rust(RustError),
Hwloc(RawHwlocError),
}
Expand description
A function errored out either on the Rust or hwloc side
This is typically used for functions which have known failure modes on the Rust side (e.g. takes a string input that must not contain NUL chars), but whose hwloc-side error reporting policy is undocumented or only partially documented.
If the hwloc documentation contains an exhaustive list of failure modes, we trust it and return a pure Rust error type, panicking if another hwloc error is observed.
Variants§
Rust(RustError)
An error was caught on the Rust side
Hwloc(RawHwlocError)
An error was caught on the hwloc side
Implementations§
source§impl<RustError: Error> HybridError<RustError>
impl<RustError: Error> HybridError<RustError>
sourcepub fn expect_only_hwloc(self, msg: &str) -> RawHwlocError
pub fn expect_only_hwloc(self, msg: &str) -> RawHwlocError
Assume that all expected Rust-side error sources have been handled and panic otherwise, but still allow unexpected hwloc errors
Trait Implementations§
source§impl<RustError: Clone + Error> Clone for HybridError<RustError>
impl<RustError: Clone + Error> Clone for HybridError<RustError>
source§fn clone(&self) -> HybridError<RustError>
fn clone(&self) -> HybridError<RustError>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<RustError> Display for HybridError<RustError>
impl<RustError> Display for HybridError<RustError>
source§impl<RustError> Error for HybridError<RustError>
impl<RustError> Error for HybridError<RustError>
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<RustError: Error> From<RustError> for HybridError<RustError>
impl<RustError: Error> From<RustError> for HybridError<RustError>
impl<RustError: Copy + Error> Copy for HybridError<RustError>
impl<RustError: Eq + Error> Eq for HybridError<RustError>
impl<RustError: Error> StructuralPartialEq for HybridError<RustError>
Auto Trait Implementations§
impl<RustError> Freeze for HybridError<RustError>where
RustError: Freeze,
impl<RustError> RefUnwindSafe for HybridError<RustError>where
RustError: RefUnwindSafe,
impl<RustError> Send for HybridError<RustError>where
RustError: Send,
impl<RustError> Sync for HybridError<RustError>where
RustError: Sync,
impl<RustError> Unpin for HybridError<RustError>where
RustError: Unpin,
impl<RustError> UnwindSafe for HybridError<RustError>where
RustError: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)