Struct RawString

Source
pub struct RawString { /* private fields */ }
Expand description

A String with unchecked contents.

It is basically a Vec<u8>, to be interpreted as string. Unlike String, there are no guarantees about the contents being valid UTF-8. Unlike Vec<u8>, its Display and Debug implementations show a string, not an array of numbers.

Implementations§

Source§

impl RawString

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn from_bytes(bytes: Vec<u8>) -> Self

Source

pub fn from_string(bytes: String) -> Self

Source

pub fn into_bytes(self) -> Vec<u8>

Source

pub fn capacity(&self) -> usize

Source

pub fn reserve(&mut self, additional: usize)

Source

pub fn reserve_exact(&mut self, additional: usize)

Source

pub fn shrink_to_fit(&mut self)

Source

pub fn clear(&mut self)

Source

pub fn truncate(&mut self, new_len: usize)

Source

pub fn pop(&mut self) -> Option<u8>

Source

pub fn remove(&mut self, idx: usize) -> u8

Source

pub fn retain<F: FnMut(u8) -> bool>(&mut self, f: F)

Source

pub fn insert(&mut self, idx: usize, b: u8)

Source

pub fn insert_str<T: AsRef<RawStr>>(&mut self, idx: usize, s: T)

Source

pub fn split_off(&mut self, at: usize) -> RawString

Source

pub fn drain<R: RangeBounds<usize>>(&mut self, range: R) -> Drain<'_, u8>

Source

pub fn replace_range<R: RangeBounds<usize>, T: AsRef<RawStr>>( &mut self, range: R, replace_with: T, )

Source

pub fn into_boxed_raw_str(self) -> Box<RawStr>

Source

pub fn push(&mut self, b: u8)

Source

pub fn push_str<T: AsRef<RawStr>>(&mut self, s: T)

Source

pub fn as_mut_bytes(&mut self) -> &mut Vec<u8>

Source

pub fn to_string(self) -> Result<String, FromUtf8Error>

Source

pub fn to_osstring(self) -> Result<OsString, FromUtf8Error>

Convert to an OsString.

On Unix, it never fails. On other platforms, it must be encoded as UTF-8.

A never-failing version for Unix only is available as unix::RawStringExt::into_osstring.

Source

pub fn to_pathbuf(self) -> Result<PathBuf, FromUtf8Error>

Convert to a PathBuf.

On Unix, it never fails. On other platforms, it must be encoded as UTF-8.

A never-failing version for Unix only is available as unix::RawStringExt::into_pathbuf.

Methods from Deref<Target = RawStr>§

Source

pub fn as_bytes(&self) -> &[u8]

Source

pub fn as_bytes_mut(&mut self) -> &mut [u8]

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn as_ptr(&self) -> *const u8

Source

pub fn first(&self) -> Option<u8>

Source

pub fn first_mut(&mut self) -> Option<&mut u8>

Source

pub fn last(&self) -> Option<u8>

Source

pub fn last_mut(&mut self) -> Option<&mut u8>

Source

pub fn split_first(&self) -> Option<(u8, &RawStr)>

Source

pub fn split_first_mut(&mut self) -> Option<(&mut u8, &mut RawStr)>

Source

pub fn split_last(&self) -> Option<(u8, &RawStr)>

Source

pub fn split_last_mut(&mut self) -> Option<(&mut u8, &mut RawStr)>

Source

pub fn split_at(&self, mid: usize) -> (&RawStr, &RawStr)

Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut RawStr, &mut RawStr)

Source

pub fn contains_byte(&self, x: u8) -> bool

Source

pub fn starts_with<T: AsRef<RawStr>>(&self, x: T) -> bool

Source

pub fn ends_with<T: AsRef<RawStr>>(&self, x: T) -> bool

Source

pub fn get<I: RawStrIndex>(&self, index: I) -> Option<&I::Output>

Source

pub fn get_mut<I: RawStrIndex>(&mut self, index: I) -> Option<&mut I::Output>

Source

pub unsafe fn get_unchecked<I: RawStrIndex>(&self, index: I) -> &I::Output

Source

pub unsafe fn get_unchecked_mut<I: RawStrIndex>( &mut self, index: I, ) -> &mut I::Output

Source

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &RawStr

Source

pub unsafe fn slice_mut_unchecked( &mut self, begin: usize, end: usize, ) -> &mut RawStr

Source

pub fn bytes(&self) -> Cloned<Iter<'_, u8>>

Source

pub fn bytes_mut(&mut self) -> IterMut<'_, u8>

Source

pub fn utf8_chunks(&self) -> Utf8ChunksIter<'_>

Iterate over chunks of valid UTF-8.

The iterator iterates over the chunks of valid UTF-8 separated by any broken characters, which could be replaced by the unicode replacement character.

Source

pub fn to_str(&self) -> Result<&str, Utf8Error>

Source

pub fn to_osstr(&self) -> Result<&OsStr, Utf8Error>

Convert to an OsStr.

On Unix, it never fails. On other platforms, it must be encoded as UTF-8.

A never-failing version for Unix only is available as unix::RawStrExt::as_osstr.

Source

pub fn to_path(&self) -> Result<&Path, Utf8Error>

Convert to a Path.

On Unix, it never fails. On other platforms, it must be encoded as UTF-8.

A never-failing version for Unix only is available as unix::RawStrExt::as_path.

Source

pub fn is_ascii(&self) -> bool

Source

pub fn eq_ignore_ascii_case(&self, other: &RawStr) -> bool

Source

pub fn make_ascii_uppercase(&mut self)

Source

pub fn make_ascii_lowercase(&mut self)

Trait Implementations§

Source§

impl AsRef<[u8]> for RawString

Source§

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

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

impl AsRef<RawStr> for RawString

Source§

fn as_ref(&self) -> &RawStr

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

impl Borrow<RawStr> for RawString

Source§

fn borrow(&self) -> &RawStr

Immutably borrows from an owned value. Read more
Source§

impl Clone for RawString

Source§

fn clone(&self) -> RawString

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 Debug for RawString

Source§

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

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

impl Default for RawString

Source§

fn default() -> RawString

Returns the “default value” for a type. Read more
Source§

impl Deref for RawString

Source§

type Target = RawStr

The resulting type after dereferencing.
Source§

fn deref(&self) -> &RawStr

Dereferences the value.
Source§

impl DerefMut for RawString

Source§

fn deref_mut(&mut self) -> &mut RawStr

Mutably dereferences the value.
Source§

impl Display for RawString

Source§

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

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

impl<'a> From<&'a [u8]> for RawString

Source§

fn from(src: &'a [u8]) -> RawString

Converts to this type from the input type.
Source§

impl<'a> From<&'a RawStr> for RawString

Source§

fn from(src: &'a RawStr) -> RawString

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for RawString

Source§

fn from(src: &'a str) -> RawString

Converts to this type from the input type.
Source§

impl From<String> for RawString

Source§

fn from(src: String) -> RawString

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for RawString

Source§

fn from(src: Vec<u8>) -> RawString

Converts to this type from the input type.
Source§

impl Hash for RawString

Source§

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

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

impl<'a> IntoIterator for &'a RawString

Source§

type Item = u8

The type of the elements being iterated over.
Source§

type IntoIter = Cloned<Iter<'a, u8>>

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<'a> IntoIterator for &'a mut RawString

Source§

type Item = &'a mut u8

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, u8>

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 IntoIterator for RawString

Source§

type Item = u8

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<u8>

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 Ord for RawString

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

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

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<&[u8]> for RawString

Source§

fn eq(&self, other: &&[u8]) -> 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 PartialEq<&RawStr> for RawString

Source§

fn eq(&self, other: &&RawStr) -> 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 PartialEq<&str> for RawString

Source§

fn eq(&self, other: &&str) -> 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 PartialEq<[u8]> for RawString

Source§

fn eq(&self, other: &[u8]) -> 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 PartialEq<RawStr> for RawString

Source§

fn eq(&self, other: &RawStr) -> 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 PartialEq<RawString> for &[u8]

Source§

fn eq(&self, other: &RawString) -> 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 PartialEq<RawString> for &RawStr

Source§

fn eq(&self, other: &RawString) -> 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 PartialEq<RawString> for &str

Source§

fn eq(&self, other: &RawString) -> 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 PartialEq<RawString> for [u8]

Source§

fn eq(&self, other: &RawString) -> 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 PartialEq<RawString> for RawStr

Source§

fn eq(&self, other: &RawString) -> 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 PartialEq<RawString> for str

Source§

fn eq(&self, other: &RawString) -> 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 PartialEq<str> for RawString

Source§

fn eq(&self, other: &str) -> 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 PartialEq for RawString

Source§

fn eq(&self, other: &RawString) -> 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 PartialOrd<&[u8]> for RawString

Source§

fn partial_cmp(&self, other: &&[u8]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<&RawStr> for RawString

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<&str> for RawString

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<[u8]> for RawString

Source§

fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawStr> for RawString

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawString> for &[u8]

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawString> for &RawStr

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawString> for &str

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawString> for [u8]

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawString> for RawStr

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<RawString> for str

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd<str> for RawString

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 PartialOrd for RawString

Source§

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

This method returns an ordering between self and other values if one exists. Read more
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 RawStringExt for RawString

Conversions only available on unix.

Source§

impl Eq for RawString

Source§

impl StructuralPartialEq for RawString

Auto Trait Implementations§

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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§

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.