domain::base::name

Struct Name

source
pub struct Name<Octs: ?Sized>(/* private fields */);
Expand description

An uncompressed, absolute domain name.

The type wraps an octets sequence that contains an absolute domain name in wire-format encoding. It provides an interface similar to a slice of the labels of the name, i.e., you can iterate over the labels, split them off, etc.

You can construct a domain name from a string via the FromStr trait or manually via a NameBuilder. In addition, you can also parse it from a message. This will, however, require the name to be uncompressed. Otherwise, you would receive a ParsedName which can be converted into Name via ToName::to_name.

The canonical way to convert a domain name into its presentation format is using to_string or by using its Display implementation (which performs no allocations).

Implementations§

source§

impl Name<()>

source

pub const MAX_LEN: usize = 255usize

Domain names have a maximum length of 255 octets.

source§

impl<Octs> Name<Octs>

§Creating Values

source

pub const unsafe fn from_octets_unchecked(octets: Octs) -> Self

Creates a domain name from the underlying octets without any check.

Since this will allow to actually construct an incorrectly encoded domain name value, the function is unsafe.

§Safety

The octets sequence passed in octets must contain a correctly encoded absolute domain name. It must be at most 255 octets long. It must contain the root label exactly once as its last label.

source

pub fn from_octets(octets: Octs) -> Result<Self, NameError>
where Octs: AsRef<[u8]>,

Creates a domain name from an octet sequence.

This will only succeed if octets contains a properly encoded absolute domain name in wire format. Because the function checks for correctness, this will take a wee bit of time.

source

pub fn from_symbols<Sym>(symbols: Sym) -> Result<Self, FromStrError>
where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder + FreezeBuilder<Octets = Octs> + AsRef<[u8]> + AsMut<[u8]>, Sym: IntoIterator<Item = Symbol>,

source

pub fn from_chars<C>(chars: C) -> Result<Self, FromStrError>
where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder + FreezeBuilder<Octets = Octs> + AsRef<[u8]> + AsMut<[u8]>, C: IntoIterator<Item = char>,

Creates a domain name from a sequence of characters.

The sequence must result in a domain name in representation format. That is, its labels should be separated by dots. Actual dots, white space and backslashes should be escaped by a preceeding backslash, and any byte value that is not a printable ASCII character should be encoded by a backslash followed by its three digit decimal value.

If Internationalized Domain Names are to be used, the labels already need to be in punycode-encoded form.

The name will always be an absolute name. If the last character in the sequence is not a dot, the function will quietly add a root label, anyway. In most cases, this is likely what you want. If it isn’t, though, use UncertainName instead to be able to check.

source

pub fn scan<S: Scanner<Name = Self>>(scanner: &mut S) -> Result<Self, S::Error>

Reads a name in presentation format from the beginning of a scanner.

source

pub fn root() -> Self
where Octs: From<&'static [u8]>,

Returns a domain name consisting of the root label only.

This function will work for any kind octets sequence that can be created from an octets slice. Since this will require providing the type parameter in some cases, there are shortcuts methods for specific octets types: root_ref, root_vec, and root_bytes.

source

pub fn reverse_from_addr(addr: IpAddr) -> Result<Self, PushError>
where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder + FreezeBuilder<Octets = Octs> + AsRef<[u8]> + AsMut<[u8]>,

Creates a domain name for reverse IP address lookup.

The returned name will use the standard suffixes of in-addr.arpa. for IPv4 addresses and ip6.arpa. for IPv6.

source§

impl Name<[u8]>

source

pub fn from_slice(slice: &[u8]) -> Result<&Self, NameError>

Creates a domain name from an octets slice.

Note that the input must be in wire format, as shown below.

§Examples
use domain::base::name::Name;
Name::from_slice(b"\x07example\x03com\x00");
§Errors

This will only succeed if slice contains a properly encoded absolute domain name.

source

pub fn root_slice() -> &'static Self

Creates a domain name for the root label only atop an octets slice.

source§

impl Name<&'static [u8]>

source

pub fn root_ref() -> Self

Creates a domain name for the root label only atop a slice reference.

source§

impl Name<Vec<u8>>

source

pub fn root_vec() -> Self

Creates a domain name for the root label only atop a Vec<u8>.

source

pub fn vec_from_str(s: &str) -> Result<Self, FromStrError>

Creates a domain name atop a Vec<u8> from its string representation.

source§

impl Name<Bytes>

source

pub fn root_bytes() -> Self

Creates a domain name for the root label only atop a bytes values.

source

pub fn bytes_from_str(s: &str) -> Result<Self, FromStrError>

Creates a domain name atop a Bytes from its string representation.

source§

impl<Octs: ?Sized> Name<Octs>

§Conversions

source

pub fn as_octets(&self) -> &Octs

Returns a reference to the underlying octets sequence.

These octets contain the domain name in wire format.

source

pub fn into_octets(self) -> Octs
where Octs: Sized,

Converts the domain name into the underlying octets sequence.

source

pub fn into_relative(self) -> RelativeName<Octs>
where Octs: Sized + AsRef<[u8]> + Truncate,

Converts the name into a relative name by dropping the root label.

source

pub fn for_ref(&self) -> Name<&Octs>

Returns a domain name using a reference to the octets.

source

pub fn as_slice(&self) -> &[u8]
where Octs: AsRef<[u8]>,

Returns a reference to the underlying octets slice.

The slice will contain the domain name in wire format.

source

pub fn for_slice(&self) -> &Name<[u8]>
where Octs: AsRef<[u8]>,

Returns a domain name for the octets slice of the content.

source

pub fn make_canonical(&mut self)
where Octs: AsMut<[u8]>,

Converts the domain name into its canonical form.

This will convert all octets that are upper case ASCII characters into their lower case equivalent.

source§

impl<Octs: AsRef<[u8]> + ?Sized> Name<Octs>

§Properties

source

pub fn is_root(&self) -> bool

Returns whether the name is the root label only.

source

pub fn len(&self) -> usize

Returns the length of the domain name.

source

pub fn fmt_with_dot(&self) -> impl Display + '_

Returns an object that displays the name with a final dot.

The name itself displays without a final dot unless the name is the root label only. Because this means you can’t just unconditionally add a dot after the name, this method can be used to display the name always ending in a single dot.

source§

impl<Octs: AsRef<[u8]> + ?Sized> Name<Octs>

§Working with Labels

source

pub fn iter(&self) -> NameIter<'_>

Returns an iterator over the labels of the domain name.

source

pub fn iter_suffixes(&self) -> SuffixIter<'_, Octs>

Returns an iterator over the suffixes of the name.

The returned iterator starts with the full name and then for each additional step returns a name with the left-most label stripped off until it reaches the root label.

source

pub fn label_count(&self) -> usize

Returns the number of labels in the domain name.

source

pub fn first(&self) -> &Label

Returns a reference to the first label.

source

pub fn last(&self) -> &'static Label

Returns a reference to the last label.

Because the last label in an absolute name is always the root label, this method can return a static reference. It is also a wee bit silly, but here for completeness.

source

pub fn starts_with<'a, N: ToLabelIter + ?Sized>(&'a self, base: &'a N) -> bool

Determines whether base is a prefix of self.

source

pub fn ends_with<'a, N: ToLabelIter + ?Sized>(&'a self, base: &'a N) -> bool

Determines whether base is a suffix of self.

source

pub fn is_label_start(&self, index: usize) -> bool

Returns whether an index points to the first byte of a non-root label.

source

pub fn slice(&self, range: impl RangeBounds<usize>) -> &RelativeName<[u8]>

Returns the part of the name indicated by start and end positions.

The returned name will start at position begin and end right before position end. Both positions are given as indexes into the underlying octets sequence and must point to the begining of a label.

The method returns a reference to an unsized relative domain name and is thus best suited for temporary referencing. If you want to keep the part of the name around, range is likely a better choice.

§Panics

The method panics if either position is not the start of a label or is out of bounds.

Because the returned domain name is relative, the method will also panic if the end is equal to the length of the name. If you want to slice the entire end of the name including the final root label, you can use slice_from instead.

source

pub fn slice_from(&self, begin: usize) -> &Name<[u8]>

Returns the part of the name starting at the given position.

The returned name will start at the given postion and cover the remainder of the name. The position begin is provided as an index into the underlying octets sequence and must point to the beginning of a label.

The method returns a reference to an unsized domain name and is thus best suited for temporary referencing. If you want to keep the part of the name around, range_from is likely a better choice.

§Panics

The method panics if begin isn’t the index of the beginning of a label or is out of bounds.

source

pub fn range( &self, range: impl RangeBounds<usize>, ) -> RelativeName<<Octs as Octets>::Range<'_>>
where Octs: Octets,

Returns the part of the name indicated by start and end positions.

The returned name will start at position begin and end right before position end. Both positions are given as indexes into the underlying octets sequence and must point to the begining of a label.

§Panics

The method panics if either position is not the start of a label or is out of bounds.

Because the returned domain name is relative, the method will also panic if the end is equal to the length of the name. If you want to slice the entire end of the name including the final root label, you can use range_from instead.

source

pub fn range_from(&self, begin: usize) -> Name<<Octs as Octets>::Range<'_>>
where Octs: Octets,

Returns the part of the name starting at the given position.

The returned name will start at the given postion and cover the remainder of the name. The position begin is provided as an index into the underlying octets sequence and must point to the beginning of a label.

§Panics

The method panics if begin isn’t the index of the beginning of a label or is out of bounds.

source§

impl<Octs: AsRef<[u8]> + ?Sized> Name<Octs>

source

pub fn split( &self, mid: usize, ) -> (RelativeName<Octs::Range<'_>>, Name<Octs::Range<'_>>)
where Octs: Octets,

Splits the name into two at the given position.

Returns a pair of the left and right part of the split name.

§Panics

The method will panic if mid is not the index of the beginning of a label or if it is out of bounds.

source

pub fn truncate(self, len: usize) -> RelativeName<Octs>
where Octs: Truncate + Sized,

Truncates the name before len.

Because truncating converts the name into a relative name, the method consumes self.

§Panics

The method will panic if len is not the index of a new label or if it is out of bounds.

source

pub fn split_first(&self) -> Option<(&Label, Name<Octs::Range<'_>>)>
where Octs: Octets,

Splits off the first label.

If this name is longer than just the root label, returns a pair of that label and the remaining name. If the name is only the root label, returns None.

source

pub fn parent(&self) -> Option<Name<Octs::Range<'_>>>
where Octs: Octets,

Returns the parent of the current name.

If the name consists of the root label only, returns None.

source

pub fn strip_suffix<N: ToName + ?Sized>( self, base: &N, ) -> Result<RelativeName<Octs>, Self>
where Octs: Truncate + Sized,

Strips the suffix base from the domain name.

If base is indeed a suffix, returns a relative domain name with the remainder of the name. Otherwise, returns an error with an unmodified self.

source§

impl<Octs> Name<Octs>

source

pub fn parse<'a, Src: Octets<Range<'a> = Octs> + ?Sized>( parser: &mut Parser<'a, Src>, ) -> Result<Self, ParseError>

Reads a name in wire format from the beginning of a parser.

Trait Implementations§

source§

impl<Octs: AsRef<[u8]> + ?Sized> AsRef<[u8]> for Name<Octs>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Octs: AsRef<[u8]>> AsRef<Name<[u8]>> for Name<Octs>

source§

fn as_ref(&self) -> &Name<[u8]>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Octs> AsRef<Octs> for Name<Octs>

source§

fn as_ref(&self) -> &Octs

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Octs: AsRef<[u8]>> Borrow<Name<[u8]>> for Name<Octs>

Borrow a domain name.

Containers holding an owned Name<_> may be queried with name over a slice. This Borrow<_> impl supports user code querying containers with compatible-but-different types like the following example:

use std::collections::HashMap;

use domain::base::Name;

fn get_description(
    hash: &HashMap<Name<Vec<u8>>, String>
) -> Option<&str> {
    let lookup_name: &Name<[u8]> =
        Name::from_slice(b"\x03www\x07example\x03com\0").unwrap();
    hash.get(lookup_name).map(|x| x.as_ref())
}
source§

fn borrow(&self) -> &Name<[u8]>

Immutably borrows from an owned value. Read more
source§

impl<Octs, N> CanonicalOrd<N> for Name<Octs>
where Octs: AsRef<[u8]> + ?Sized, N: ToName + ?Sized,

source§

fn canonical_cmp(&self, other: &N) -> Ordering

Returns the canonical ordering between self and other.
source§

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

Returns whether self is canonically less than other.
source§

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

Returns whether self is canonically less than or equal to other.
source§

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

Returns whether self is canonically greater than other.
source§

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

Returns whether self is canonically greater than or equal to other.
source§

impl<Octs: Clone + ?Sized> Clone for Name<Octs>

source§

fn clone(&self) -> Name<Octs>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Octs: AsRef<[u8]> + ?Sized> Debug for Name<Octs>

source§

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

Formats the value using the given formatter. Read more
source§

impl<Octs: AsRef<[u8]> + ?Sized> Display for Name<Octs>

source§

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

Formats the domain name.

This will produce the domain name in ‘common display format’ without the trailing dot with the exception of a root name which will be just a dot.

source§

impl<L, R, Target> FlattenInto<Name<Target>> for Chain<L, R>
where L: ToRelativeName, R: ToName + FlattenInto<Name<Target>, AppendError = BuilderAppendError<Target>>, Target: FromBuilder, <Target as FromBuilder>::Builder: EmptyBuilder,

source§

impl<Octs, Target> FlattenInto<Name<Target>> for Name<Octs>
where Target: OctetsFrom<Octs>,

source§

type AppendError = <Target as OctetsFrom<Octs>>::Error

source§

fn try_flatten_into(self) -> Result<Name<Target>, Self::AppendError>

source§

impl<Octs, Target> FlattenInto<Name<Target>> for ParsedName<Octs>
where Octs: Octets, Target: FromBuilder, <Target as FromBuilder>::Builder: EmptyBuilder,

source§

impl<Octets> From<Name<Octets>> for UncertainName<Octets>

source§

fn from(src: Name<Octets>) -> Self

Converts to this type from the input type.
source§

impl<Octs: AsRef<[u8]>> From<Name<Octs>> for ParsedName<Octs>

source§

fn from(name: Name<Octs>) -> ParsedName<Octs>

Converts to this type from the input type.
source§

impl From<Name<SmallVec<[u8; 24]>>> for SearchList

source§

fn from(name: SearchSuffix) -> Self

Converts to this type from the input type.
source§

impl<Octs> FromStr for Name<Octs>
where Octs: FromBuilder, <Octs as FromBuilder>::Builder: EmptyBuilder + FreezeBuilder<Octets = Octs> + AsRef<[u8]> + AsMut<[u8]>,

source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string into an absolute domain name.

The name needs to be formatted in representation format, i.e., as a sequence of labels separated by dots. If Internationalized Domain Name (IDN) labels are to be used, these need to be given in punycode encoded form.

The implementation assumes that the string refers to an absolute name whether it ends in a dot or not. If you need to be able to distinguish between those two cases, you can use UncertainDname instead.

source§

type Err = FromStrError

The associated error which can be returned from parsing.
source§

impl<Octs: AsRef<[u8]> + ?Sized> Hash for Name<Octs>

source§

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

Feeds this value into the given Hasher. Read more
source§

impl<'a, Octs> IntoIterator for &'a Name<Octs>
where Octs: AsRef<[u8]> + ?Sized,

source§

type Item = &'a Label

The type of the elements being iterated over.
source§

type IntoIter = NameIter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<Octs, SrcOcts> OctetsFrom<Name<SrcOcts>> for Name<Octs>
where Octs: OctetsFrom<SrcOcts>,

source§

type Error = <Octs as OctetsFrom<SrcOcts>>::Error

source§

fn try_octets_from(source: Name<SrcOcts>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<Octs: AsRef<[u8]> + ?Sized> Ord for Name<Octs>

source§

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

Returns the ordering between self and other.

Domain name order is determined according to the ‘canonical DNS name order’ as defined in section 6.1 of RFC 4034.

source§

impl<Octs, N> PartialEq<N> for Name<Octs>
where Octs: AsRef<[u8]> + ?Sized, N: ToName + ?Sized,

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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.
source§

impl<Octs, N> PartialOrd<N> for Name<Octs>
where Octs: AsRef<[u8]> + ?Sized, N: ToName + ?Sized,

source§

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

Returns the ordering between self and other.

Domain name order is determined according to the ‘canonical DNS name order’ as defined in section 6.1 of RFC 4034.

1.0.0 · 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 · 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 · 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 · 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
source§

impl<Octs> ToLabelIter for Name<Octs>
where Octs: AsRef<[u8]> + ?Sized,

source§

type LabelIter<'a> = NameIter<'a> where Octs: 'a

The type of the iterator over the labels. Read more
source§

fn iter_labels(&self) -> Self::LabelIter<'_>

Returns an iterator over the labels.
source§

fn compose_len(&self) -> u16

Returns the length in octets of the encoded name.
source§

fn starts_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool

Determines whether base is a prefix of self.
source§

fn ends_with<N: ToLabelIter + ?Sized>(&self, base: &N) -> bool

Determines whether base is a suffix of self.
source§

impl<Octs: AsRef<[u8]> + ?Sized> ToName for Name<Octs>

source§

fn as_flat_slice(&self) -> Option<&[u8]>

Returns an octets slice of the content if possible. Read more
source§

fn try_to_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single, uncompressed name. Read more
source§

fn to_name<Octets>(&self) -> Name<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single, uncompressed name. Read more
source§

fn try_to_canonical_name<Octets>( &self, ) -> Result<Name<Octets>, BuilderAppendError<Octets>>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,

Converts the name into a single name in canonical form.
source§

fn to_canonical_name<Octets>(&self) -> Name<Octets>
where Octets: FromBuilder, <Octets as FromBuilder>::Builder: OctetsBuilder<AppendError = Infallible> + EmptyBuilder,

Converts the name into a single name in canonical form. Read more
source§

fn compose<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn compose_canonical<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>

source§

fn to_cow(&self) -> Name<Cow<'_, [u8]>>

Returns a cow of the domain name. Read more
source§

fn to_vec(&self) -> Name<Vec<u8>>

Returns the domain name assembled into a Vec<u8>.
source§

fn to_bytes(&self) -> Name<Bytes>

Returns the domain name assembled into a bytes value.
source§

fn name_eq<N: ToName + ?Sized>(&self, other: &N) -> bool

Tests whether self and other are equal. Read more
source§

fn name_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the ordering between self and other. Read more
source§

fn composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the composed name ordering.
source§

fn lowercase_composed_cmp<N: ToName + ?Sized>(&self, other: &N) -> Ordering

Returns the lowercase composed ordering.
source§

fn rrsig_label_count(&self) -> u8

Returns the number of labels for the RRSIG Labels field. Read more
source§

impl<Octs: AsRef<[u8]> + ?Sized> Eq for Name<Octs>

Auto Trait Implementations§

§

impl<Octs> Freeze for Name<Octs>
where Octs: Freeze + ?Sized,

§

impl<Octs> RefUnwindSafe for Name<Octs>
where Octs: RefUnwindSafe + ?Sized,

§

impl<Octs> Send for Name<Octs>
where Octs: Send + ?Sized,

§

impl<Octs> Sync for Name<Octs>
where Octs: Sync + ?Sized,

§

impl<Octs> Unpin for Name<Octs>
where Octs: Unpin + ?Sized,

§

impl<Octs> UnwindSafe for Name<Octs>
where Octs: UnwindSafe + ?Sized,

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
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, dst: *mut T)

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

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

source§

type Error = <Target as OctetsFrom<Source>>::Error

source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

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

Initializes a with the given initializer. Read more
source§

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

Dereferences the given pointer. Read more
source§

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

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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
source§

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

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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