Skip to main content

Host

Enum Host 

#[non_exhaustive]
pub enum Host { Name(Domain), Address(IpAddr), Uninterpreted(UninterpretedHost), }
Available on crate feature net only.
Expand description

Either a Domain, an IpAddr, or UninterpretedHost bytes preserved verbatim from a URI authority.

Uninterpreted covers the RFC 3986 host shapes that aren’t a strict DNS-label-shaped Domain or a recognized IP address — pct-encoded reg-name (exa%6Dple.com), sub-delim hostnames (tag,with,commas), IPvFuture literals ([vN.X]), and raw UTF-8 host bytes preserved under graceful URI / IRI parsing. The variant exists so a proxy receiving wire bytes can forward them faithfully; callers needing a canonical typed form convert via the TryFrom impls on UninterpretedHost.

Equality, hashing, and ordering bridge across variant boundaries per RFC 3986 §6.2.2.2: see HostRef’s type-level docs.

§Empty Uninterpreted host

RFC 3986 §3.2.2 reg-name = *(...) permits empty bytes, so URIs like file:///path or unix:///run/x parse with Host::Uninterpreted(b""). This is URI-valid but not network-valid — protocol writers that have no representation for “no host” (SOCKS5, TLS SNI, HTTP Host:) will refuse it. Code dispatching a Host onto a network call must either reject the empty case or substitute a sensible default.

§Alternate IPv4 forms (SSRF awareness)

Inputs that look like IP addresses but aren’t accepted by Rust’s Ipv4Addr::from_str — octal (0177.0.0.1), hex (0x7f.0.0.1), 3-part (127.0.1), and integer (2130706433) — parse as Host::Name(Domain) rather than Host::Address, because each label is digit-only and passes the DNS-label byte set. This is RFC 3986 compliant (the strings are reg-names under §3.2.2) but diverges from browsers, which normalise all four to 127.0.0.1.

SSRF caveat: code that filters destination addresses on Host::Address will see 0177.0.0.1 as a Name and bypass IP-based allowlists / blocklists. Either:

  • resolve through DNS (loopback returns naturally) before applying the filter, OR
  • reject any Name whose labels look digit-only at the policy layer, OR
  • call crate::uri::Uri::canonicalize first — it doesn’t promote these to Address (Rust’s strict parser still rejects), so this is informational rather than a fix.

§Why #[non_exhaustive]

Variant matching is a footgun on this type: a Domain can live in Name or in Uninterpreted (pct-encoded bytes that decode to a domain), and an IpAddr can live in Address or in Uninterpreted (pct-encoded dotted-quad). External callers that pattern-match on the variant tag will miss the bridged forms. Use try_as_domain / try_as_ip (and the try_into_* consuming counterparts) which bridge across variants.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Name(Domain)

A DNS-label-shaped name (ASCII, IDN normalised to ACE on construction via Domain::try_from).

§

Address(IpAddr)

A literal IPv4 or IPv6 address.

§

Uninterpreted(UninterpretedHost)

Host bytes preserved verbatim. See UninterpretedHost.

Implementations§

§

impl Host

pub fn try_as_domain( &self, ) -> Result<Cow<'_, Domain>, Box<dyn Error + Send + Sync>>

Returns true if this is the Host::Name variant. View as a Domain, bridging the Uninterpreted variant. Cow::Borrowed for Name; Cow::Owned for an Uninterpreted whose pct-decoded (and IDN-normalized) bytes parse as a domain. Address and IPvFuture-bracketed Uninterpreted fail.

pub fn try_into_domain(self) -> Result<Domain, Box<dyn Error + Send + Sync>>

Consuming form of try_as_domain.

pub fn try_as_ip(&self) -> Result<IpAddr, Box<dyn Error + Send + Sync>>

View as an IpAddr, bridging the Uninterpreted variant. Returns the address from Address directly; Uninterpreted succeeds when its pct-decoded bytes parse as an IPv4 or IPv6 address. Name and IPvFuture-bracketed Uninterpreted fail.

pub fn view(&self) -> HostRef<'_>

Borrowed view. Same shape as From<&Self> for HostRef but surfaces the borrowed view as an inherent method so call sites don’t need the trait in scope.

pub fn to_str(&self) -> Cow<'_, str>

Returns this host as a string. See HostRef::to_str for the borrow / allocation behavior.

pub fn as_unicode(&self) -> Cow<'_, str>

Available on crate feature idna only.

Returns the Unicode (display) form of this host. For named hosts, any xn-- A-labels are inverse-encoded via UTS #46. IP addresses are rendered to their standard textual form.

Cow::Borrowed when no conversion is needed; Cow::Owned for IP addresses and IDN A-labels that actually require decoding.

§

impl Host

pub const LOCALHOST_IPV4: Host

Local loopback address (IPv4)

pub const LOCALHOST_IPV6: Host

Local loopback address (IPv6)

pub const LOCALHOST_NAME: Host

Local loopback name

pub const DEFAULT_IPV4: Host

Default address, not routable

pub const DEFAULT_IPV6: Host

Default address, not routable (IPv6)

pub const BROADCAST_IPV4: Host

Broadcast address (IPv4)

pub const EXAMPLE_NAME: Host

example.com domain name

pub const fn from_static(s: &'static str) -> Host

Compile-time constructor for a Domain-shaped host. Panics at compile time when s isn’t a valid domain.

Trait Implementations§

§

impl Clone for Host

§

fn clone(&self) -> Host

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Host

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Host

§

fn deserialize<D>( deserializer: D, ) -> Result<Host, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for Host

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl DomainLabels for Host

§

type LabelIter<'a> = HostLabelIter<'a>

Iterator over the labels of self, yielded most-specific-first ("www.example.com".labels() yields www, example, com).
§

fn labels(&self) -> <Host as DomainLabels>::LabelIter<'_>

Returns an iterator over the labels of self.
§

fn label_count(&self) -> usize

Returns the number of labels.
§

fn starts_with<D>(&self, prefix: &D) -> bool
where D: DomainLabels + ?Sized,

Returns true if self’s labels start with prefix’s labels (most-specific-end). Read more
§

fn ends_with<D>(&self, suffix: &D) -> bool
where D: DomainLabels + ?Sized,

Returns true if self’s labels end with suffix’s labels (TLD-end). Read more
§

fn is_subdomain_of<D>(&self, parent: &D) -> bool
where D: DomainLabels + ?Sized,

Returns true if self is a subdomain of parent (or equal to it). Read more
§

fn parent(&self) -> Option<Domain>

Returns the parent Domain (everything but the leftmost label), or None if self has fewer than two labels.
§

fn suffix_iter(&self) -> SuffixIter<'_, Self>
where Self: Sized,

Iterator over self and each successive parent, ending just before the empty domain. For "a.b.c" yields "a.b.c", "b.c", "c".
§

impl<'a> From<&'a Host> for HostRef<'a>

§

fn from(h: &'a Host) -> HostRef<'a>

Converts to this type from the input type.
§

impl From<Authority> for Host

§

fn from(authority: Authority) -> Host

Converts to this type from the input type.
§

impl From<Domain> for Host

§

fn from(domain: Domain) -> Host

Converts to this type from the input type.
§

impl From<Host> for Authority

§

fn from(host: Host) -> Authority

Converts to this type from the input type.
§

impl From<Host> for ForwardedAuthority

§

fn from(value: Host) -> ForwardedAuthority

Converts to this type from the input type.
§

impl From<Host> for Host

§

fn from(host: Host) -> Host

Converts to this type from the input type.
§

impl From<Host> for Host

§

fn from(value: Host) -> Host

Converts to this type from the input type.
§

impl From<Host> for HostWithOptPort

§

fn from(host: Host) -> HostWithOptPort

Converts to this type from the input type.
§

impl From<HostWithOptPort> for Host

§

fn from(hwop: HostWithOptPort) -> Host

Converts to this type from the input type.
§

impl From<HostWithPort> for Host

§

fn from(hwp: HostWithPort) -> Host

Converts to this type from the input type.
§

impl From<IpAddr> for Host

§

fn from(ip: IpAddr) -> Host

Converts to this type from the input type.
§

impl From<Ipv4Addr> for Host

§

fn from(ip: Ipv4Addr) -> Host

Converts to this type from the input type.
§

impl From<Ipv6Addr> for Host

§

fn from(ip: Ipv6Addr) -> Host

Converts to this type from the input type.
§

impl FromStr for Host

§

type Err = Box<dyn Error + Send + Sync>

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Host, <Host as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for Host

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl IntoCanonicalIpAddr for Host

§

impl Ord for Host

§

fn cmp(&self, other: &Host) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq<&str> for Host

§

fn eq(&self, other: &&str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Host> for &str

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Host> for IpAddr

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Host> for Ipv4Addr

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Host> for Ipv6Addr

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Host> for String

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Host> for str

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<IpAddr> for Host

§

fn eq(&self, other: &IpAddr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Ipv4Addr> for Host

§

fn eq(&self, other: &Ipv4Addr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<Ipv6Addr> for Host

§

fn eq(&self, other: &Ipv6Addr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<String> for Host

§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<str> for Host

§

fn eq(&self, other: &str) -> bool

ASCII-case-insensitive compare against a string, matching Domain / Uri / Eq for Host (RFC 3986 §6.2.2.1).

1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq for Host

§

fn eq(&self, other: &Host) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Host

§

fn partial_cmp(&self, other: &Host) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl<'a> RamaTryFrom<&'a Host, RamaTlsRustlsCrateMarker> for ServerName<'a>

§

impl<'a> RamaTryFrom<&ServerName<'a>, RamaTlsRustlsCrateMarker> for Host

§

impl RamaTryFrom<Host, RamaTlsRustlsCrateMarker> for ServerName<'_>

§

impl<'a> RamaTryFrom<ServerName<'a>, RamaTlsRustlsCrateMarker> for Host

§

impl Serialize for Host

§

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 TraceField for Host

§

type Ref<'a> = &'a str

The zero-copy decoded form of this field.
§

fn field_type() -> FieldType

§

fn encode<W>(&self, enc: &mut EventEncoder<'_, W>) -> Result<(), Error>
where W: Write,

Encode this field’s value into the event encoder.
§

fn decode_ref<'a>( val: &FieldValueRef<'a>, ) -> Option<<Host as TraceField>::Ref<'a>>

Extract this field’s value from a zero-copy FieldValueRef.
§

fn is_optional() -> bool

Whether this field is optional on the wire (high-bit modifier).
§

fn decode_missing<'a>() -> Option<Self::Ref<'a>>

Called when the field is absent from the wire data (not in the schema). Returns None for required fields (decode failure) and Some(None) for optional fields.
§

impl TryFrom<&[u8]> for Host

§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
§

fn try_from(name: &[u8]) -> Result<Host, <Host as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl TryFrom<&HeaderValue> for Host

Available on crate feature http only.
§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
§

fn try_from( header: &HeaderValue, ) -> Result<Host, <Host as TryFrom<&HeaderValue>>::Error>

Performs the conversion.
§

impl TryFrom<&str> for Host

§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
§

fn try_from(name: &str) -> Result<Host, <Host as TryFrom<&str>>::Error>

Performs the conversion.
§

impl TryFrom<HeaderValue> for Host

Available on crate feature http only.
§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
§

fn try_from( header: HeaderValue, ) -> Result<Host, <Host as TryFrom<HeaderValue>>::Error>

Performs the conversion.
§

impl TryFrom<String> for Host

§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
§

fn try_from(name: String) -> Result<Host, <Host as TryFrom<String>>::Error>

Performs the conversion.
§

impl TryFrom<Vec<u8>> for Host

§

type Error = Box<dyn Error + Send + Sync>

The type returned in the event of a conversion error.
§

fn try_from(name: Vec<u8>) -> Result<Host, <Host as TryFrom<Vec<u8>>>::Error>

Performs the conversion.
§

impl Eq for Host

Auto Trait Implementations§

§

impl !Freeze for Host

§

impl RefUnwindSafe for Host

§

impl Send for Host

§

impl Sync for Host

§

impl Unpin for Host

§

impl UnsafeUnpin for Host

§

impl UnwindSafe for Host

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a rama_grpc::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

impl<T, U> RamaFrom<T> for U
where U: From<T>,

§

fn rama_from(value: T) -> U

§

impl<T, U, CrateMarker> RamaInto<U, CrateMarker> for T
where U: RamaFrom<T, CrateMarker>,

§

fn rama_into(self) -> U

§

impl<T, U> RamaTryFrom<T> for U
where 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 T
where 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>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

§

fn to_smolstr(&self) -> SmolStr

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<V, F> ValueFormatter<&V> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &&V)

Write value to writer
§

impl<V, F> ValueFormatter<Arc<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Arc<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Box<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Box<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Cow<'_, V>> for F
where V: ToOwned + ?Sized, F: ValueFormatter<V> + ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)

Write value to writer
§

impl<V, F> ValueFormatter<Option<V>> for F
where F: ValueFormatter<V> + ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Option<V>)

Write value to writer
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,