Struct hls_audio_server::server::HLSServer
source · pub struct HLSServer { /* private fields */ }
Expand description
HLS Server implementation based on hyper.
Implementations§
source§impl HLSServer
impl HLSServer
sourcepub async fn new(addr: SocketAddr, playlist: Playlist) -> Result<Self>
pub async fn new(addr: SocketAddr, playlist: Playlist) -> Result<Self>
Creates a new server with the given address and Playlist.
sourcepub async fn serve_data<F>(self, data_callback: F) -> Result<(), Box<dyn Error>>where
F: FnMut() -> Vec<u8> + Send + 'static,
pub async fn serve_data<F>(self, data_callback: F) -> Result<(), Box<dyn Error>>where F: FnMut() -> Vec<u8> + Send + 'static,
Makes the audio from the callback available over HLS.
To guarantee smooth playback the length of the audio clip needs to be equal to the segment length specified in HLSConfig.
The callback is called at the same rate as the length of the clip.
Auto Trait Implementations§
impl RefUnwindSafe for HLSServer
impl Send for HLSServer
impl Sync for HLSServer
impl Unpin for HLSServer
impl UnwindSafe for HLSServer
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