#[non_exhaustive]pub struct Route {
pub broadcast: String,
pub resource: Resource,
}Expand description
A parsed request path: the broadcast, and the resource under it.
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.broadcast: StringThe broadcast path, percent-decoded. An embedder that scopes its origin rewrites
this relative to that scope before calling Server::respond.
resource: ResourceThe resource requested under the broadcast.
Implementations§
Source§impl Route
impl Route
Sourcepub fn parse(path: &str) -> Option<Self>
pub fn parse(path: &str) -> Option<Self>
Parse a request path such as /project/live/video/hd/media.m3u8, or None when it
addresses nothing.
The broadcast occupies every segment before the resource suffix. Each segment is
percent-decoded, and one that decodes to a / is refused, so an encoded separator
cannot smuggle a different broadcast past a policy check on broadcast.
Trait Implementations§
impl Eq for Route
impl StructuralPartialEq for Route
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnsafeUnpin for Route
impl UnwindSafe for Route
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