pub struct SnapServer { /* private fields */ }Expand description
The embeddable Snapcast server.
Implementations§
Source§impl SnapServer
Convert f32 samples to PCM bytes at the given bit depth.
impl SnapServer
Convert f32 samples to PCM bytes at the given bit depth.
Sourcepub fn new(config: ServerConfig) -> (Self, Receiver<ServerEvent>)
pub fn new(config: ServerConfig) -> (Self, Receiver<ServerEvent>)
Create a new server. Returns the server and event receiver.
Sourcepub fn add_stream(&mut self, name: &str) -> Sender<AudioFrame>
pub fn add_stream(&mut self, name: &str) -> Sender<AudioFrame>
Add a named audio stream. Returns a sender for pushing audio frames.
Uses the server’s default codec and sample format.
Sourcepub fn add_stream_with_config(
&mut self,
name: &str,
config: StreamConfig,
) -> Sender<AudioFrame>
pub fn add_stream_with_config( &mut self, name: &str, config: StreamConfig, ) -> Sender<AudioFrame>
Add a named audio stream with per-stream codec/format overrides.
Sourcepub fn command_sender(&self) -> Sender<ServerCommand>
pub fn command_sender(&self) -> Sender<ServerCommand>
Get a cloneable command sender.
Sourcepub fn config(&self) -> &ServerConfig
pub fn config(&self) -> &ServerConfig
Access the server configuration.
Auto Trait Implementations§
impl Freeze for SnapServer
impl !RefUnwindSafe for SnapServer
impl Send for SnapServer
impl Sync for SnapServer
impl Unpin for SnapServer
impl UnsafeUnpin for SnapServer
impl !UnwindSafe for SnapServer
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