pub struct HardwareProfile {
pub cores: u32,
pub memory_gb: u32,
pub gpu_vendor: String,
pub gpu_renderer: String,
}Expand description
Hardware configuration.
§Example
use stygian_browser::profile::HardwareProfile;
let h = HardwareProfile::desktop_gaming();
assert_eq!(h.cores, 8);Fields§
§cores: u32navigator.hardwareConcurrency.
memory_gb: u32navigator.deviceMemory in GB (must be a power of 2: 1, 2, 4, 8, 16, 32).
gpu_vendor: StringGPU vendor string (for navigator.gpu hint, complementing WebGL).
gpu_renderer: StringGPU renderer string.
Implementations§
Source§impl HardwareProfile
impl HardwareProfile
Sourcepub fn desktop_gaming() -> Self
pub fn desktop_gaming() -> Self
8-core, 8 GB desktop gaming rig.
Sourcepub fn desktop_gtx1660() -> Self
pub fn desktop_gtx1660() -> Self
8-core, 8 GB mid-range GPU desktop.
Sourcepub fn intel_uhd_630() -> Self
pub fn intel_uhd_630() -> Self
Intel 4-core, 4 GB budget desktop.
Sourcepub fn mobile_snapdragon() -> Self
pub fn mobile_snapdragon() -> Self
Mobile — 8-core Snapdragon, 4 GB.
Trait Implementations§
Source§impl Clone for HardwareProfile
impl Clone for HardwareProfile
Source§fn clone(&self) -> HardwareProfile
fn clone(&self) -> HardwareProfile
Returns a duplicate 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 Debug for HardwareProfile
impl Debug for HardwareProfile
Source§impl<'de> Deserialize<'de> for HardwareProfile
impl<'de> Deserialize<'de> for HardwareProfile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HardwareProfile
impl RefUnwindSafe for HardwareProfile
impl Send for HardwareProfile
impl Sync for HardwareProfile
impl Unpin for HardwareProfile
impl UnsafeUnpin for HardwareProfile
impl UnwindSafe for HardwareProfile
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