pub struct Host { /* private fields */ }Expand description
Representation of the host subcomponent of the URI.
Implementations§
Source§impl Host
impl Host
Sourcepub fn new<P>(host_pattern: P, root: Resource) -> Self
pub fn new<P>(host_pattern: P, root: Resource) -> Self
Creates a new Host with the given pattern and root resource.
use argan::{Host, Resource};
let root = Resource::new("/");
let host = Host::new("http://{sub_domain}.example.com", root);The Host node checks the request’s host and, if matches, passes the request to
its root resource.
Sourcepub fn is<P: AsRef<str>>(&self, pattern: P) -> bool
pub fn is<P: AsRef<str>>(&self, pattern: P) -> bool
Checks whether the given pattern is the Host’s pattern.
Sourcepub fn into_service(self) -> HostService
pub fn into_service(self) -> HostService
Converts the Host into a service.
Sourcepub fn into_arc_service(self) -> ArcHostService
pub fn into_arc_service(self) -> ArcHostService
Converts the Host into a service that uses Arc internally.
Sourcepub fn into_leaked_service(self) -> LeakedHostService
pub fn into_leaked_service(self) -> LeakedHostService
Converts the Host into a service with a leaked &'static.
Auto Trait Implementations§
impl Freeze for Host
impl !RefUnwindSafe for Host
impl !Send for Host
impl !Sync for Host
impl Unpin for Host
impl !UnwindSafe for Host
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