pub struct RequesterProxy { /* private fields */ }
Implementations§
Source§impl RequesterProxy
impl RequesterProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.power.systemmode/Requester.
Sourcepub fn take_event_stream(&self) -> RequesterEventStream
pub fn take_event_stream(&self) -> RequesterEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn request(
&self,
mode: SystemMode,
set: bool,
) -> QueryResponseFut<RequesterRequestResult, DefaultFuchsiaResourceDialect>
pub fn request( &self, mode: SystemMode, set: bool, ) -> QueryResponseFut<RequesterRequestResult, DefaultFuchsiaResourceDialect>
Requests to set or clear a system power mode.
The call returns immediately after the request has been received, validated, and accepted. Actual system changes to be applied as a result of this request will occur after the call has returned. Therefore, any errors that occur while updating clients according to the new system power mode are not propagated back to the caller. Instead, client updates are applied on a “best effort” basis.
An error returned by this method means the request itself is not valid and was rejected. Details of the specific rejection reason are reflected by the error value. In the event of an error, the channel will remain open.
A client can use this method to set or clear system power mode variants independently. For example:
// battery is below the “low” threshold Request(LOW_BATTERY, true);
// device is now plugged into the wall Request(ON_AC_POWER, true);
// battery is now above the “low” threshold Request(LOW_BATTERY, false);
mode
is theSystemMode
to request to be set or clearedset
should be true to request to setmode
, or false to clear it
- error a
ModeRequestError
value indicating why the request was rejected.
Trait Implementations§
Source§impl Clone for RequesterProxy
impl Clone for RequesterProxy
Source§fn clone(&self) -> RequesterProxy
fn clone(&self) -> RequesterProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RequesterProxy
impl Debug for RequesterProxy
Source§impl Proxy for RequesterProxy
impl Proxy for RequesterProxy
Source§type Protocol = RequesterMarker
type Protocol = RequesterMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Source§impl RequesterProxyInterface for RequesterProxy
impl RequesterProxyInterface for RequesterProxy
type RequestResponseFut = QueryResponseFut<Result<(), ModeRequestError>>
fn request(&self, mode: SystemMode, set: bool) -> Self::RequestResponseFut
Auto Trait Implementations§
impl Freeze for RequesterProxy
impl !RefUnwindSafe for RequesterProxy
impl Send for RequesterProxy
impl Sync for RequesterProxy
impl Unpin for RequesterProxy
impl !UnwindSafe for RequesterProxy
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
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)
clone_to_uninit
)