pub enum DeviceRequest {
GetRailMetadata {
responder: DeviceGetRailMetadataResponder,
},
GetPowerWatts {
payload: Options,
responder: DeviceGetPowerWattsResponder,
},
GetCurrentAmperes {
payload: Options,
responder: DeviceGetCurrentAmperesResponder,
},
GetEnergyJoules {
payload: Options,
responder: DeviceGetEnergyJoulesResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: DeviceControlHandle,
method_type: MethodType,
},
}Expand description
Provides power and power-related measurements for a single rail.
Variants§
GetRailMetadata
Returns metadata for the rail.
Fields
§
responder: DeviceGetRailMetadataResponderGetPowerWatts
Returns the power consumption. Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
GetCurrentAmperes
Returns the current. Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
GetEnergyJoules
Returns the energy consumption. Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
control_handle: DeviceControlHandle§
method_type: MethodTypeImplementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_get_rail_metadata(self) -> Option<DeviceGetRailMetadataResponder>
pub fn into_get_power_watts( self, ) -> Option<(Options, DeviceGetPowerWattsResponder)>
pub fn into_get_current_amperes( self, ) -> Option<(Options, DeviceGetCurrentAmperesResponder)>
pub fn into_get_energy_joules( self, ) -> Option<(Options, DeviceGetEnergyJoulesResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceRequest
impl !UnwindSafe for DeviceRequest
impl Freeze for DeviceRequest
impl Send for DeviceRequest
impl Sync for DeviceRequest
impl Unpin for DeviceRequest
impl UnsafeUnpin for DeviceRequest
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