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§
Source§impl<'de> Deserialize<'de> for GpuInfo
impl<'de> Deserialize<'de> for GpuInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GpuInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GpuInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for GpuInfo
impl Serialize for GpuInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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