pub enum ChargerRequest {
GetSpec {
responder: ChargerGetSpecResponder,
},
GetStatus {
responder: ChargerGetStatusResponder,
},
SetChargingEnabled {
enabled: bool,
responder: ChargerSetChargingEnabledResponder,
},
Watch {
interest: Status,
wake_on: Status,
lease: Option<EventPair>,
responder: ChargerWatchResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: ChargerControlHandle,
method_type: MethodType,
},
}Variants§
GetSpec
Returns static hardware characteristics of the charger.
Fields
§
responder: ChargerGetSpecResponderGetStatus
Returns the current dynamic status of the charger immediately.
Fields
§
responder: ChargerGetStatusResponderSetChargingEnabled
Control methods.
Errors:
NOT_SUPPORTED: If the hardware does not support enabling/disabling charging.INTERNAL: If an unexpected error occurred.
Watch
Change notification for charger state using a “hanging-get” pattern.
Follows the same semantics and power management rules as
[fuchsia.hardware.power.source/Source.Watch].
§Errors
ALREADY_BOUNDifWatchis called before the previous call completes.
#[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: ChargerControlHandle§
method_type: MethodTypeImplementations§
Source§impl ChargerRequest
impl ChargerRequest
pub fn into_get_spec(self) -> Option<ChargerGetSpecResponder>
pub fn into_get_status(self) -> Option<ChargerGetStatusResponder>
pub fn into_set_charging_enabled( self, ) -> Option<(bool, ChargerSetChargingEnabledResponder)>
pub fn into_watch( self, ) -> Option<(Status, Status, Option<EventPair>, ChargerWatchResponder)>
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 ChargerRequest
impl !UnwindSafe for ChargerRequest
impl Freeze for ChargerRequest
impl Send for ChargerRequest
impl Sync for ChargerRequest
impl Unpin for ChargerRequest
impl UnsafeUnpin for ChargerRequest
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