pub struct GpuInfo {
pub id: u32,
pub name: String,
pub memory_total: u64,
pub memory_free: u64,
}Expand description
GPU device information.
Fields§
§id: u32GPU device ID.
name: StringGPU name (e.g., “NVIDIA RTX 4090”).
memory_total: u64Total memory in bytes.
memory_free: u64Free memory in bytes.
Implementations§
Source§impl GpuInfo
impl GpuInfo
Sourcepub fn memory_total_gb(&self) -> f64
pub fn memory_total_gb(&self) -> f64
Get total memory in gigabytes.
Sourcepub fn memory_free_gb(&self) -> f64
pub fn memory_free_gb(&self) -> f64
Get free memory in gigabytes.
Sourcepub fn memory_used_percent(&self) -> f64
pub fn memory_used_percent(&self) -> f64
Get memory usage percentage.
Trait Implementations§
impl Eq for GpuInfo
impl StructuralPartialEq for GpuInfo
Auto Trait Implementations§
impl Freeze for GpuInfo
impl RefUnwindSafe for GpuInfo
impl Send for GpuInfo
impl Sync for GpuInfo
impl Unpin for GpuInfo
impl UnsafeUnpin for GpuInfo
impl UnwindSafe for GpuInfo
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