pub enum Error {
PlatformInit(String),
NoDevicesFound,
DeviceAccess(String),
PermissionDenied(String),
NotSupported(String),
Io(Error),
}Expand description
The main error type for all-smi library operations.
This enum covers all possible error conditions that can occur when using the all-smi library, from initialization failures to device access issues.
Variants§
PlatformInit(String)
Platform initialization failed.
This error occurs when the underlying platform-specific libraries or APIs cannot be initialized (e.g., NVML, IOReport, hl-smi).
NoDevicesFound
No supported devices were found on the system.
This is not necessarily an error condition - it simply indicates that no GPUs, NPUs, or other accelerators were detected.
DeviceAccess(String)
Device access error occurred.
This error occurs when a device was detected but could not be accessed or queried for metrics.
PermissionDenied(String)
Permission denied when accessing device resources.
Some platforms require elevated privileges to access certain metrics (e.g., AMD GPUs on Linux require sudo access).
NotSupported(String)
Feature not supported on this platform.
This error is returned when attempting to use functionality that is not available on the current platform or hardware.
Io(Error)
An I/O error occurred.
This wraps standard I/O errors that may occur during file system operations or process execution.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.