pub struct OriginKey {
pub scheme: Scheme,
pub host: Arc<str>,
pub port: u16,
}Expand description
Connection identity. Precomputed telemetry attributes hang off the pool entry for this key.
Fields§
§scheme: Scheme§host: Arc<str>Lowercased host exactly as in the URI authority: IPv6 literals keep their brackets
([::1]), so it can be used verbatim in a Host header. Use OriginKey::connect_host to dial.
port: u16Implementations§
Source§impl OriginKey
impl OriginKey
Sourcepub fn from_uri(uri: &Uri) -> Result<Self>
pub fn from_uri(uri: &Uri) -> Result<Self>
Derives the origin from an absolute URI. Default ports are 80/443.
§Errors
InvalidRequest if the scheme is missing or not http/https, or the authority/host is missing.
Sourcepub fn connect_host(&self) -> &str
pub fn connect_host(&self) -> &str
Host without IPv6 brackets, suitable for DNS / IpAddr parsing / TLS SNI.
pub const fn is_tls(&self) -> bool
Trait Implementations§
impl Eq for OriginKey
impl StructuralPartialEq for OriginKey
Auto Trait Implementations§
impl Forget for OriginKey
impl Freeze for OriginKey
impl Move for OriginKey
impl RefUnwindSafe for OriginKey
impl Send for OriginKey
impl Sync for OriginKey
impl Unpin for OriginKey
impl UnsafeUnpin for OriginKey
impl UnwindSafe for OriginKey
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