pub struct OdpmDevice { /* private fields */ }Expand description
An ODPM device aggregating power rails.
Implementations§
Source§impl OdpmDevice
impl OdpmDevice
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new, uninitialized OdpmDevice.
Sourcepub fn init(&self, rails: BTreeMap<u32, Arc<OdpmRail>>)
pub fn init(&self, rails: BTreeMap<u32, Arc<OdpmRail>>)
Initializes this device with the discovered rails.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Returns whether the device has completed initial rail discovery.
Sourcepub fn energy_value(&self) -> Result<FsString, Errno>
pub fn energy_value(&self) -> Result<FsString, Errno>
Reads energy measurements across all rails and formats them for the energy_value sysfs file.
Returns a formatted string containing the maximum timestamp across all rail samples, followed by each rail’s channel ID, sample duration, schematic name, and cumulative energy. If reading an individual rail fails, cached readings or default values are used.
Sourcepub fn enabled_rails(&self) -> FsString
pub fn enabled_rails(&self) -> FsString
Formats rail configuration for the enabled_rails sysfs file.
Trait Implementations§
Source§impl Debug for OdpmDevice
impl Debug for OdpmDevice
Auto Trait Implementations§
impl !Freeze for OdpmDevice
impl !RefUnwindSafe for OdpmDevice
impl !UnwindSafe for OdpmDevice
impl Send for OdpmDevice
impl Sync for OdpmDevice
impl Unpin for OdpmDevice
impl UnsafeUnpin for OdpmDevice
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more