pub struct Authority {
pub host: String,
pub port: Port,
}
Expand description
Represent the http URI scheme that is returned by the HTTP host header
Further information can be found: https://www.rfc-editor.org/rfc/rfc7230#section-2.7.1
Fields§
§host: String
The host.
port: Port
The port.
Implementations§
source§impl Authority
impl Authority
sourcepub fn from_http_request<T>(request: &HttpRequest<T>) -> Option<Self>
pub fn from_http_request<T>(request: &HttpRequest<T>) -> Option<Self>
Attempts to parse the authority from a HTTP request.
The Authority
can be sent by the client in the Host header
or in the URI
such that both must be checked.
Trait Implementations§
source§impl TryFrom<SocketAddr> for Authority
impl TryFrom<SocketAddr> for Authority
source§type Error = AuthorityError
type Error = AuthorityError
The type returned in the event of a conversion error.
impl Eq for Authority
impl StructuralPartialEq for Authority
Auto Trait Implementations§
impl Freeze for Authority
impl RefUnwindSafe for Authority
impl Send for Authority
impl Sync for Authority
impl Unpin for Authority
impl UnwindSafe for Authority
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.