pub struct SmiSource;Implementations§
Source§impl SmiSource
impl SmiSource
Sourcepub fn snapshot() -> Vec<GpuSnapshot>
pub fn snapshot() -> Vec<GpuSnapshot>
Invoke nvidia-smi and parse the output. Returns an empty Vec if the
binary isn’t present or returns non-zero.
Cost note: this fork/execs nvidia-smi, which takes on the order of
tens of milliseconds — not microseconds. Call from a blocking task
(e.g. tokio::task::spawn_blocking) if invoked from an async context.
Sourcepub fn parse_snapshot(text: &str) -> Vec<GpuSnapshot>
pub fn parse_snapshot(text: &str) -> Vec<GpuSnapshot>
Pure parser — split out for testability.
Auto Trait Implementations§
impl Freeze for SmiSource
impl RefUnwindSafe for SmiSource
impl Send for SmiSource
impl Sync for SmiSource
impl Unpin for SmiSource
impl UnsafeUnpin for SmiSource
impl UnwindSafe for SmiSource
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more