Struct ServerName
pub struct ServerName(/* private fields */);Available on crate feature
net only.Expand description
A canonical network host restricted to DNS names and IP addresses. IP literals received in SNI are retained even though RFC 6066 excludes them.
As an extension it is the name a TLS client verifies the server certificate against and, per the client’s SNI policy, offers as SNI; a later layer may overwrite it.
Implementations§
§impl ServerName
impl ServerName
pub fn parse(name: &str) -> Option<ServerName>
pub fn parse(name: &str) -> Option<ServerName>
Parse a received SNI name through the network host parser.
pub fn as_dns_host(&self) -> Option<DomainRef<'_>>
pub fn as_dns_host(&self) -> Option<DomainRef<'_>>
The DNS host name as certificates and SNI spell it, without a trailing dot.
None for an address, and for a name that only its trailing dot keeps from
spelling one, such as 192.0.2.1..
pub fn into_domain(self) -> Option<Domain>
pub fn into_domain(self) -> Option<Domain>
Consume this name and return its DNS identity, if present.
Trait Implementations§
§impl Clone for ServerName
impl Clone for ServerName
§fn clone(&self) -> ServerName
fn clone(&self) -> ServerName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ServerName
impl Debug for ServerName
§impl<'de> Deserialize<'de> for ServerName
impl<'de> Deserialize<'de> for ServerName
§fn deserialize<D>(
deserializer: D,
) -> Result<ServerName, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ServerName, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ServerName
impl Display for ServerName
impl Eq for ServerName
§impl Extension for ServerName
impl Extension for ServerName
§fn scope() -> ExtensionScope
fn scope() -> ExtensionScope
How far up an
Extensions chain a lookup of this type resolves,
ExtensionScope::Flow unless the type says otherwise.§impl<'a> From<&'a ServerName> for HostRef<'a>
impl<'a> From<&'a ServerName> for HostRef<'a>
§fn from(name: &'a ServerName) -> HostRef<'a>
fn from(name: &'a ServerName) -> HostRef<'a>
Converts to this type from the input type.
§impl From<&ServerName> for Host
impl From<&ServerName> for Host
§fn from(name: &ServerName) -> Host
fn from(name: &ServerName) -> Host
Converts to this type from the input type.
§impl From<Domain> for ServerName
impl From<Domain> for ServerName
§fn from(domain: Domain) -> ServerName
fn from(domain: Domain) -> ServerName
Converts to this type from the input type.
§impl From<IpAddr> for ServerName
impl From<IpAddr> for ServerName
§fn from(ip: IpAddr) -> ServerName
fn from(ip: IpAddr) -> ServerName
Converts to this type from the input type.
§impl From<ServerName> for Host
impl From<ServerName> for Host
§fn from(name: ServerName) -> Host
fn from(name: ServerName) -> Host
Converts to this type from the input type.
§impl FromStr for ServerName
impl FromStr for ServerName
§impl Hash for ServerName
impl Hash for ServerName
§impl PartialEq for ServerName
impl PartialEq for ServerName
§impl<'a> RamaTryFrom<&'a ServerName, RamaTlsRustlsCrateMarker> for ServerName<'a>
impl<'a> RamaTryFrom<&'a ServerName, RamaTlsRustlsCrateMarker> for ServerName<'a>
type Error = Box<dyn Error + Sync + Send>
fn rama_try_from( value: &'a ServerName, ) -> Result<ServerName<'a>, <ServerName<'a> as RamaTryFrom<&'a ServerName, RamaTlsRustlsCrateMarker>>::Error>
§impl Serialize for ServerName
impl Serialize for ServerName
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ServerName
impl TlsExtension for ServerName
§impl TraceField for ServerName
Available on crate feature dial9 only.
impl TraceField for ServerName
Available on crate feature
dial9 only.fn field_type() -> FieldType
§fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>where
W: Write,
fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>where
W: Write,
Encode this field’s value into the event encoder.
§fn is_optional() -> bool
fn is_optional() -> bool
Whether this field is optional on the wire (high-bit modifier).
§impl TryFrom<&Host> for ServerName
impl TryFrom<&Host> for ServerName
Auto Trait Implementations§
impl !Freeze for ServerName
impl Forget for ServerName
impl Move for ServerName
impl RefUnwindSafe for ServerName
impl Send for ServerName
impl Sync for ServerName
impl Unpin for ServerName
impl UnsafeUnpin for ServerName
impl UnwindSafe for ServerName
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.