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§
Sourcefn permission(&self) -> MicrophonePermission
fn permission(&self) -> MicrophonePermission
The permission as the platform reports it now.
Sourcefn request(&self)
fn request(&self)
Shows the system prompt. The backend calls
publish_microphone_permission when the person answers.
Sourcefn open_settings(&self)
fn open_settings(&self)
Opens the system settings page of this application.
Provided Methods§
Sourcefn prepare_recording(&self) -> Result<(), String>
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".