Skip to main content

SuspendBlockerLocalServerHandler

Trait SuspendBlockerLocalServerHandler 

Source
pub trait SuspendBlockerLocalServerHandler<___T = Channel>
where ___T: Transport,
{ // Required methods fn before_suspend( &mut self, responder: Responder<BeforeSuspend, ___T>, ) -> impl Future<Output = ()>; fn after_resume( &mut self, responder: Responder<AfterResume, ___T>, ) -> impl Future<Output = ()>; // Provided method fn on_unknown_interaction( &mut self, ordinal: u64, ) -> impl Future<Output = ()> { ... } }
Expand description

A server handler for the SuspendBlocker protocol.

See SuspendBlocker for more details.

Required Methods§

Source

fn before_suspend( &mut self, responder: Responder<BeforeSuspend, ___T>, ) -> impl Future<Output = ()>

Called after system activity governor begins operations to suspend the hardware platform.

The server is expected to respond once it has performed the operations it needs to prepare itself for suspend, if any. All dependencies of ExecutionStateLevel::SUSPENDING are guaranteed to be satisified for the duration of this call and may be revoked once the server replies.

Operations to suspend the hardware platform may vary between different hardware platforms and product configurations. At a minimum, the client and server MUST assume that general code execution continues until a reply to this call is received by the client. If the SuspendBlocker wants to preempt suspend operations, it MUST call ActivityGovernor.AcquireWakeLease before replying to this call.

ExecutionState will be at its SUSPENDING level for the duration of this call. Consequently, a SuspendBlocker MUST NOT call ActivityGovernor.TakeApplicationActivityLease nor perform any other action that blocks on Execution State reaching a level other than INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease does not block in this way and is safe to call.)

Source

fn after_resume( &mut self, responder: Responder<AfterResume, ___T>, ) -> impl Future<Output = ()>

Called after system activity governor is aware that the hardware platform has resumed.

For the duration of this call, ExecutionState is at level INACTIVE, but all dependencies of ExecutionStateLevel::SUSPENDING are guaranteed be satisified.

Consequently, a SuspendBlocker MUST NOT call ActivityGovernor.TakeApplicationActivityLease nor perform any other action that blocks on Execution State reaching a level other than INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease does not block in this way and is safe to call.)

Provided Methods§

Source

fn on_unknown_interaction(&mut self, ordinal: u64) -> impl Future<Output = ()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<___H, ___T> SuspendBlockerLocalServerHandler<___T> for Local<___H>
where ___H: SuspendBlockerServerHandler<___T>, ___T: Transport,

Source§

async fn before_suspend(&mut self, responder: Responder<BeforeSuspend, ___T>)

Source§

async fn after_resume(&mut self, responder: Responder<AfterResume, ___T>)

Source§

async fn on_unknown_interaction(&mut self, ordinal: u64)

Implementors§