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: StringThe host.
port: PortThe 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§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.