Skip to main content

PermissionHandler

Trait PermissionHandler 

Source
pub trait PermissionHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        request_id: RequestId,
        data: PermissionRequestData,
    ) -> Pin<Box<dyn Future<Output = PermissionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handler for permission.requested broadcasts.

Install via SessionConfig::with_permission_handler (or the matching method on ResumeSessionConfig). When no permission handler is supplied, the SDK sends requestPermission: false on the wire and the runtime short-circuits permission prompts for this client.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, session_id: SessionId, request_id: RequestId, data: PermissionRequestData, ) -> Pin<Box<dyn Future<Output = PermissionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Resolve a permission request.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§