pub struct Server { /* private fields */ }Expand description
HLS export HTTP server. Cheap to clone (shared inner).
Implementations§
Source§impl Server
impl Server
Sourcepub async fn respond(&self, route: &Route, query: Option<&str>) -> Response
pub async fn respond(&self, route: &Route, query: Option<&str>) -> Response
Answer a parsed Route from this server’s origin: the handler behind
router, for an embedder that parses and authorizes the request
itself.
query is the raw request query (without the leading ?), propagated to every
child URL a playlist or manifest lists, so a credential carried there reaches the
player’s follow-up requests.
Source§impl Server
impl Server
Sourcepub fn new(origin: Consumer, config: Config) -> Self
pub fn new(origin: Consumer, config: Config) -> Self
Build a server reading broadcasts from origin. Every request is served;
gate access by layering middleware onto router.
Sourcepub fn router(&self) -> Router
pub fn router(&self) -> Router
The axum router for the HLS endpoints, ready to nest or wrap in middleware.
Sourcepub async fn broadcaster(&self, name: &str) -> Option<Arc<Broadcaster>>
pub async fn broadcaster(&self, name: &str) -> Option<Arc<Broadcaster>>
Get or create the Broadcaster for name, resolving the broadcast from
the relay (waiting briefly for its announcement). Returns None if the
broadcast never shows up.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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