Trait AudioPermissionDelegate

Source
pub trait AudioPermissionDelegate: Send + Sync {
    // Required methods
    fn request_permission(&self) -> Result<(), BoxError>;
    fn poll_permission(&self) -> Poll<Result<bool, BoxError>>;
}
Expand description

Asks the host whether the guest may capture audio. Implementations must not block: they run on the audio executor. One delegate is shared by all capture streams of a card, so streams waiting at the same time share one request and all receive its answer.

Required Methods§

Source

fn request_permission(&self) -> Result<(), BoxError>

Sends a permission request to the host unless one is already outstanding.

Source

fn poll_permission(&self) -> Poll<Result<bool, BoxError>>

Returns the host’s answer to the outstanding request, or Poll::Pending if it has not answered yet.

Implementors§