#[repr(u32)]pub enum Profile {
Idle = 1,
BackgroundActive = 2,
UserActive = 3,
}
Expand description
System power profiles that may be returned by [Watcher.Watch].
Variants§
Idle = 1
There is no active work in the system. On a system that supports it, the device may be put into a lower-power or suspended state at any time.
BackgroundActive = 2
Some background activity is occurring that should prevent the system from dropping into a non-running or suspended state (example: downloading an OTA, performing a backup, or CPU-based hotword monitoring).
UserActive = 3
The device is providing some user-visible experience such as running an app in the foreground or streaming audio, or has recently received interaction from a user.
Implementations§
Source§impl Profile
impl Profile
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
👎Deprecated: Strict enums should not use
is_unknown
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<Profile, D> for Profile
impl<D: ResourceDialect> Decode<Profile, D> for Profile
Source§impl Ord for Profile
impl Ord for Profile
Source§impl PartialOrd for Profile
impl PartialOrd for Profile
Source§impl TypeMarker for Profile
impl TypeMarker for Profile
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 Profile
impl ValueTypeMarker for Profile
impl Copy for Profile
impl Eq for Profile
impl StructuralPartialEq for Profile
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnwindSafe for Profile
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)