Skip to main content

MicrophoneAccess

Trait MicrophoneAccess 

Source
pub trait MicrophoneAccess: Send + Sync {
    // Required methods
    fn permission(&self) -> MicrophonePermission;
    fn request(&self);
    fn open_settings(&self);

    // Provided method
    fn prepare_recording(&self) -> Result<(), String> { ... }
}
Expand description

A platform’s microphone permission, installed by the platform backend.

Required Methods§

Source

fn permission(&self) -> MicrophonePermission

The permission as the platform reports it now.

Source

fn request(&self)

Shows the system prompt. The backend calls publish_microphone_permission when the person answers.

Source

fn open_settings(&self)

Opens the system settings page of this application.

Provided Methods§

Source

fn prepare_recording(&self) -> Result<(), String>

Readies the platform’s audio for recording, where opening an input stream is not enough: iOS and watchOS record only in a session whose category takes input.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§