Enum PowerPreference
#[repr(C)]pub enum PowerPreference {
None = 0,
LowPower = 1,
HighPerformance = 2,
}Expand description
Power Preference when choosing a physical adapter.
Corresponds to WebGPU GPUPowerPreference.
Variants§
None = 0
Power usage is not considered when choosing an adapter.
LowPower = 1
Adapter that uses the least possible power. This is often an integrated GPU.
HighPerformance = 2
Adapter that has the highest performance. This is often a discrete GPU.
Implementations§
§impl PowerPreference
impl PowerPreference
pub fn from_env() -> Option<PowerPreference>
pub fn from_env() -> Option<PowerPreference>
Get a power preference from the environment variable WGPU_POWER_PREF.
Trait Implementations§
§impl Clone for PowerPreference
impl Clone for PowerPreference
§fn clone(&self) -> PowerPreference
fn clone(&self) -> PowerPreference
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 more§impl Debug for PowerPreference
impl Debug for PowerPreference
§impl Default for PowerPreference
impl Default for PowerPreference
§fn default() -> PowerPreference
fn default() -> PowerPreference
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for PowerPreference
impl<'de> Deserialize<'de> for PowerPreference
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PowerPreference, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PowerPreference, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Hash for PowerPreference
impl Hash for PowerPreference
§impl PartialEq for PowerPreference
impl PartialEq for PowerPreference
§impl Serialize for PowerPreference
impl Serialize for PowerPreference
§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 Copy for PowerPreference
impl Eq for PowerPreference
impl StructuralPartialEq for PowerPreference
Auto Trait Implementations§
impl Freeze for PowerPreference
impl RefUnwindSafe for PowerPreference
impl Send for PowerPreference
impl Sync for PowerPreference
impl Unpin for PowerPreference
impl UnwindSafe for PowerPreference
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more