#[non_exhaustive]pub struct Config {
pub rate: u32,
pub channels: Channels,
pub voices: usize,
pub sounds: usize,
pub streams: usize,
}Expand description
What a mixer is made with. All its memory comes from these.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rate: u32The output’s frames a second.
channels: ChannelsThe output’s channels.
voices: usizeThe most voices sounding at once.
sounds: usizeThe most sounds in the bank at once.
streams: usizeThe most streams held at once.
Implementations§
Source§impl Config
impl Config
Sourcepub const DEFAULT_SOUNDS: usize = 256
pub const DEFAULT_SOUNDS: usize = 256
A bank’s size by default.
Sourcepub const DEFAULT_STREAMS: usize = 2
pub const DEFAULT_STREAMS: usize = 2
Two, for a crossfade.
Sourcepub const fn new(rate: u32, channels: Channels, voices: usize) -> Self
pub const fn new(rate: u32, channels: Channels, voices: usize) -> Self
Self::DEFAULT_SOUNDS sounds and Self::DEFAULT_STREAMS streams.
Sourcepub const fn with_sounds(self, sounds: usize) -> Self
pub const fn with_sounds(self, sounds: usize) -> Self
With room for sounds sounds.
Sourcepub const fn with_streams(self, streams: usize) -> Self
pub const fn with_streams(self, streams: usize) -> Self
With room for streams streams.
Trait Implementations§
impl Copy for Config
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more