pub struct ActivityGovernorProxy { /* private fields */ }
Implementations§
Source§impl ActivityGovernorProxy
impl ActivityGovernorProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.power.system/ActivityGovernor.
Sourcepub fn take_event_stream(&self) -> ActivityGovernorEventStream
pub fn take_event_stream(&self) -> ActivityGovernorEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn get_power_elements(
&self,
) -> QueryResponseFut<PowerElements, DefaultFuchsiaResourceDialect>
pub fn get_power_elements( &self, ) -> QueryResponseFut<PowerElements, DefaultFuchsiaResourceDialect>
Gets the power elements owned by the activity governor.
If an error occurs while the server is registering a power element with
the power broker or an error occurs while creating a token for a power
element, then the channel to ActivityGovernor
will be closed by the
server and no response will be returned.
Sourcepub fn take_wake_lease(
&self,
name: &str,
) -> QueryResponseFut<EventPair, DefaultFuchsiaResourceDialect>
pub fn take_wake_lease( &self, name: &str, ) -> QueryResponseFut<EventPair, DefaultFuchsiaResourceDialect>
Creates a lease that blocks suspension of the hardware platform.
The hardware platform will not suspend as long as a valid
LeaseToken
exists.
If an error occurs while creating a token for the wake lease, then the
channel to ActivityGovernor
will be closed by the server and no
response will be returned.
Sourcepub fn take_application_activity_lease(
&self,
name: &str,
) -> QueryResponseFut<EventPair, DefaultFuchsiaResourceDialect>
pub fn take_application_activity_lease( &self, name: &str, ) -> QueryResponseFut<EventPair, DefaultFuchsiaResourceDialect>
Creates a lease that blocks the system from dropping below the Application Activity ‘Active’ state. In particular, this blocks suspension of the hardware platform.
If an error occurs while creating a token for the activity lease, then the
channel to ActivityGovernor
will be closed by the server and no
response will be returned.
Sourcepub fn register_listener(
&self,
payload: ActivityGovernorRegisterListenerRequest,
) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn register_listener( &self, payload: ActivityGovernorRegisterListenerRequest, ) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
Registers a listener for activity governor events.
If there is an error in registering the listener, then the given
ActivityGovernorListener
channel will be closed before the response
is sent.
To unregister, close the ActivityGovernorListener
channel.
Trait Implementations§
Source§impl ActivityGovernorProxyInterface for ActivityGovernorProxy
impl ActivityGovernorProxyInterface for ActivityGovernorProxy
type GetPowerElementsResponseFut = QueryResponseFut<PowerElements>
type TakeWakeLeaseResponseFut = QueryResponseFut<EventPair>
type TakeApplicationActivityLeaseResponseFut = QueryResponseFut<EventPair>
type RegisterListenerResponseFut = QueryResponseFut<()>
fn get_power_elements(&self) -> Self::GetPowerElementsResponseFut
fn take_wake_lease(&self, name: &str) -> Self::TakeWakeLeaseResponseFut
fn take_application_activity_lease( &self, name: &str, ) -> Self::TakeApplicationActivityLeaseResponseFut
fn register_listener( &self, payload: ActivityGovernorRegisterListenerRequest, ) -> Self::RegisterListenerResponseFut
Source§impl Clone for ActivityGovernorProxy
impl Clone for ActivityGovernorProxy
Source§fn clone(&self) -> ActivityGovernorProxy
fn clone(&self) -> ActivityGovernorProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ActivityGovernorProxy
impl Debug for ActivityGovernorProxy
Source§impl Proxy for ActivityGovernorProxy
impl Proxy for ActivityGovernorProxy
Source§type Protocol = ActivityGovernorMarker
type Protocol = ActivityGovernorMarker
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>
Auto Trait Implementations§
impl Freeze for ActivityGovernorProxy
impl !RefUnwindSafe for ActivityGovernorProxy
impl Send for ActivityGovernorProxy
impl Sync for ActivityGovernorProxy
impl Unpin for ActivityGovernorProxy
impl !UnwindSafe for ActivityGovernorProxy
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
)