INNER CODE UNIT · Rust
config
RustAudio/cpal · src/lib.rs:574
pub fn config(&self) -> StreamConfig {
StreamConfig {
channels: self.channels,
sample_rate: self.sample_rate,
buffer_size: BufferSize::Default,
}
}
}
// Note: Data does not implement `is_empty()` because it always contains a valid audio buffer
// by design. The buffer may contain silence, but it is never structurally empty.
#[expect(clippy::len_without_is_empty)]
impl Data {
/// Constructor for host implementations to use.
///
/// # Safety
/// The following requirements must be met in order for the safety of `Data`'s API.
/// - The `data` pointer must point to the first sample in the slice containing all samples.