pub struct HostRouter {
pub routers: FastHashMap<ByteString, Router>,
pub fallback_host: Option<ByteString>,
}
Available on crate feature
axum
only.Expand description
Host router.
Fields§
§routers: FastHashMap<ByteString, Router>
Routers by host (with optional port).
fallback_host: Option<ByteString>
Fallback host (with optional port).
If a router is not found for a host will fallback to the router for this host instead.
There must be a router mapped to this host.
Implementations§
Source§impl HostRouter
impl HostRouter
Sourcepub fn into_router(self) -> Option<Router>
pub fn into_router(self) -> Option<Router>
Into Router.
Sourcepub fn add(&mut self, host_and_optional_port: ByteString, router: Router)
pub fn add(&mut self, host_and_optional_port: ByteString, router: Router)
Add.
Sourcepub fn fallback_router(&mut self) -> Option<&mut Router>
pub fn fallback_router(&mut self) -> Option<&mut Router>
Fallback Router.
Trait Implementations§
Source§impl Clone for HostRouter
impl Clone for HostRouter
Source§fn clone(&self) -> HostRouter
fn clone(&self) -> HostRouter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HostRouter
impl Debug for HostRouter
Source§impl Default for HostRouter
impl Default for HostRouter
Source§fn default() -> HostRouter
fn default() -> HostRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for HostRouter
impl !RefUnwindSafe for HostRouter
impl Send for HostRouter
impl Sync for HostRouter
impl Unpin for HostRouter
impl !UnwindSafe for HostRouter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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