Struct system_power_mode_config::ClientConfig
source · pub struct ClientConfig {
pub mode_matches: Vec<ModeMatch, Global>,
pub default_level: u64,
}
Expand description
Defines the power configuration for a [ClientType
].
For a client connected with a given [ClientType
], the PowerManager will
use the configured ClientConfig
for that [ClientType
] to choose the
appropriate power level based on the currently active system power modes.
The power level selection process is as follows for a given [ClientType
]:
- Iterate through the [
ClientConfig.mode_matches
] entries. If themode
value specified by an entry is contained in the currently active system power modes, then the correspondingpower_level
from that entry will be selected as this client’s current power level, and iteration for this client will stop. - If no entry in
mode_matches
was matched, thendefault_level
will be selected as the client’s current power level.
Fields§
§mode_matches: Vec<ModeMatch, Global>
§default_level: u64
Trait Implementations§
source§impl ClientConfigExt for ClientConfig
impl ClientConfigExt for ClientConfig
source§impl ClientConfigTestExt for ClientConfig
impl ClientConfigTestExt for ClientConfig
source§fn new(default_level: u64) -> Self
fn new(default_level: u64) -> Self
Creates an empty ClientConfig
which consists of a default level and no ModeMatch
entries.
source§fn append_mode_match(self, mode: SystemMode, power_level: u64) -> Self
fn append_mode_match(self, mode: SystemMode, power_level: u64) -> Self
Appends a mode match entry to the end of the existing entries.
source§impl Clone for ClientConfig
impl Clone for ClientConfig
source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a copy 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 ClientConfig
impl Debug for ClientConfig
source§impl Decode<ClientConfig> for ClientConfig
impl Decode<ClientConfig> for ClientConfig
source§fn new_empty() -> ClientConfig
fn new_empty() -> ClientConfig
Creates a valid instance of
Self
. The specific value does not matter,
since it will be overwritten by decode
.source§impl Encode<ClientConfig> for &ClientConfig
impl Encode<ClientConfig> for &ClientConfig
source§impl Hash for ClientConfig
impl Hash for ClientConfig
source§impl Ord for ClientConfig
impl Ord for ClientConfig
source§fn cmp(&self, other: &ClientConfig) -> Ordering
fn cmp(&self, other: &ClientConfig) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<ClientConfig> for ClientConfig
impl PartialEq<ClientConfig> for ClientConfig
source§fn eq(&self, other: &ClientConfig) -> bool
fn eq(&self, other: &ClientConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ClientConfig> for ClientConfig
impl PartialOrd<ClientConfig> for ClientConfig
source§fn partial_cmp(&self, other: &ClientConfig) -> Option<Ordering>
fn partial_cmp(&self, other: &ClientConfig) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TypeMarker for ClientConfig
impl TypeMarker for ClientConfig
§type Owned = ClientConfig
type Owned = ClientConfig
The owned Rust type which this FIDL type decodes into.
source§fn inline_align(context: Context) -> usize
fn inline_align(context: Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
source§fn inline_size(context: Context) -> usize
fn inline_size(context: Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for alignment. Must be a multiple of
inline_align
.source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moresource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Returns true if the memory layout of
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for ClientConfig
impl ValueTypeMarker for ClientConfig
§type Borrowed = &'a <ClientConfig as TypeMarker>::Owned
type Borrowed = &'a <ClientConfig as TypeMarker>::Owned
The Rust type to use for encoding. This is a particular
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moresource§fn borrow<'a>(
value: &'a <ClientConfig as TypeMarker>::Owned
) -> <ClientConfig as ValueTypeMarker>::Borrowed<'a>
fn borrow<'a>( value: &'a <ClientConfig as TypeMarker>::Owned ) -> <ClientConfig as ValueTypeMarker>::Borrowed<'a>
Cheaply converts from
&Self::Owned
to Self::Borrowed
.