pub struct ActivityGovernorSynchronousProxy { /* private fields */ }
Implementations§
Source§impl ActivityGovernorSynchronousProxy
impl ActivityGovernorSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<ActivityGovernorEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<ActivityGovernorEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn get_power_elements(
&self,
___deadline: MonotonicInstant,
) -> Result<PowerElements, Error>
pub fn get_power_elements( &self, ___deadline: MonotonicInstant, ) -> Result<PowerElements, Error>
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,
___deadline: MonotonicInstant,
) -> Result<EventPair, Error>
pub fn take_wake_lease( &self, name: &str, ___deadline: MonotonicInstant, ) -> Result<EventPair, Error>
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 acquire_wake_lease(
&self,
name: &str,
___deadline: MonotonicInstant,
) -> Result<ActivityGovernorAcquireWakeLeaseResult, Error>
pub fn acquire_wake_lease( &self, name: &str, ___deadline: MonotonicInstant, ) -> Result<ActivityGovernorAcquireWakeLeaseResult, Error>
Creates a lease that blocks suspension of the hardware platform.
The hardware platform will not suspend as long as a valid
LeaseToken
exists.
Sourcepub fn take_application_activity_lease(
&self,
name: &str,
___deadline: MonotonicInstant,
) -> Result<EventPair, Error>
pub fn take_application_activity_lease( &self, name: &str, ___deadline: MonotonicInstant, ) -> Result<EventPair, Error>
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,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn register_listener( &self, payload: ActivityGovernorRegisterListenerRequest, ___deadline: MonotonicInstant, ) -> Result<(), Error>
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 SynchronousProxy for ActivityGovernorSynchronousProxy
impl SynchronousProxy for ActivityGovernorSynchronousProxy
Source§type Proxy = ActivityGovernorProxy
type Proxy = ActivityGovernorProxy
Source§type Protocol = ActivityGovernorMarker
type Protocol = ActivityGovernorMarker
Proxy
controls.