Struct internment::ArcIntern

source ·
pub struct ArcIntern<T: ?Sized + Eq + Hash + Send + Sync + 'static> { /* private fields */ }
Expand description

A pointer to a reference-counted interned object.

This type requires feature “arc”. The interned object will be held in memory only until its reference count reaches zero.

§Example

use internment::ArcIntern;

let x = ArcIntern::new("hello");
let y = ArcIntern::new("world");
assert_ne!(x, y);
assert_eq!(x, ArcIntern::new("hello"));
assert_eq!(*x, "hello"); // dereference an ArcIntern like a pointer

§Example with owned String data

use internment::ArcIntern;

let x = ArcIntern::new("hello".to_string());
let y = ArcIntern::<String>::from_ref("world");
assert_eq!(x, ArcIntern::from_ref("hello"));
assert_eq!(&*x, "hello"); // dereference an ArcIntern like a pointer

Implementations§

source§

impl<T: ?Sized + Eq + Hash + Send + Sync + 'static> ArcIntern<T>

source

pub fn from_ref<'a, Q: ?Sized + Eq + Hash + 'a>(val: &'a Q) -> ArcIntern<T>
where T: Borrow<Q> + From<&'a Q>,

Intern a value from a reference with atomic reference counting.

If this value has not previously been interned, then new will allocate a spot for the value on the heap and generate that value using T::from(val).

source

pub fn num_objects_interned() -> usize

See how many objects have been interned. This may be helpful in analyzing memory use.

source

pub fn refcount(&self) -> usize

Return the number of counts for this pointer.

source

pub fn benchmarking_only_clear_interns()

Only for benchmarking, this will cause problems

source§

impl<T: Eq + Hash + Send + Sync + 'static> ArcIntern<T>

source

pub fn new(val: T) -> ArcIntern<T>

Intern a value. If this value has not previously been interned, then new will allocate a spot for the value on the heap. Otherwise, it will return a pointer to the object previously allocated.

Note that ArcIntern::new is a bit slow, since it needs to check a DashMap which is protected by internal sharded locks.

Trait Implementations§

source§

impl<T: ?Sized + Send + Sync + Hash + Eq> AsRef<T> for ArcIntern<T>

source§

fn as_ref(&self) -> &T

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

impl<T: ?Sized + Eq + Hash + Send + Sync + 'static> Clone for ArcIntern<T>

source§

fn clone(&self) -> Self

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<T: ?Sized + Eq + Hash + Send + Sync + Debug> Debug for ArcIntern<T>

source§

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

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

impl<T: ?Sized + Eq + Hash + Send + Sync + 'static> DeepSizeOf for ArcIntern<T>

source§

fn deep_size_of_children(&self, _context: &mut Context) -> usize

Returns an estimation of the heap-managed storage of this object. This does not include the size of the object itself. Read more
source§

fn deep_size_of(&self) -> usize

Returns an estimation of a total size of memory owned by the object, including heap-managed storage. Read more
source§

impl<T> Default for ArcIntern<[T]>
where T: Copy + Send + Sync + Hash + Eq + 'static,

source§

fn default() -> Self

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

impl<T: Eq + Hash + Send + Sync + Default + 'static> Default for ArcIntern<T>

source§

fn default() -> Self

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

impl Default for ArcIntern<str>

source§

fn default() -> Self

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

impl<T: ?Sized + Eq + Hash + Send + Sync> Deref for ArcIntern<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<'de: 'a, 'a> Deserialize<'de> for ArcIntern<[u8]>

Available on crate feature serde only.
source§

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

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

impl<'de, T> Deserialize<'de> for ArcIntern<T>
where T: Eq + Hash + Send + Sync + 'static + Deserialize<'de>,

Available on crate feature serde only.
source§

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

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

impl<'de: 'a, 'a> Deserialize<'de> for ArcIntern<str>

Available on crate feature serde only.
source§

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

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

impl<T: ?Sized + Eq + Hash + Send + Sync + Display> Display for ArcIntern<T>

source§

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

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

impl<T: ?Sized + Eq + Hash + Send + Sync> Drop for ArcIntern<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> From<&[T]> for ArcIntern<[T]>
where T: Copy + Send + Sync + Hash + Eq + 'static,

source§

fn from(slice: &[T]) -> Self

Converts to this type from the input type.
source§

impl From<&str> for ArcIntern<str>

source§

fn from(s: &str) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> From<Arc<[T]>> for ArcIntern<[T]>

source§

fn from(f: Arc<[T]>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Arc<str>> for ArcIntern<str>

source§

fn from(f: Arc<str>) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> From<Box<[T]>> for ArcIntern<[T]>

source§

fn from(f: Box<[T]>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Box<str>> for ArcIntern<str>

source§

fn from(f: Box<str>) -> Self

Converts to this type from the input type.
source§

impl<'a, B> From<Cow<'a, B>> for ArcIntern<B>
where B: ToOwned + ?Sized + Send + Sync + Hash + Eq, ArcIntern<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

source§

fn from(c: Cow<'a, B>) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> From<Rc<[T]>> for ArcIntern<[T]>

source§

fn from(f: Rc<[T]>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Rc<str>> for ArcIntern<str>

source§

fn from(f: Rc<str>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<String> for ArcIntern<str>

source§

fn from(f: String) -> Self

Converts to this type from the input type.
source§

impl<T: Eq + Hash + Send + Sync + 'static> From<T> for ArcIntern<T>

source§

fn from(t: T) -> Self

Converts to this type from the input type.
source§

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> From<Vec<T>> for ArcIntern<[T]>

source§

fn from(f: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T: ?Sized + Eq + Hash + Send + Sync> Hash for ArcIntern<T>

The hash implementation returns the hash of the pointer value, not the hash of the value pointed to. This should be irrelevant, since there is a unique pointer for every value, but it is observable, since you could compare the hash of the pointer with hash of the data itself.

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<T: ?Sized + Eq + Hash + Send + Sync + Ord> Ord for ArcIntern<T>

source§

fn cmp(&self, other: &Self) -> 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 + PartialOrd,

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<&'a [T]> for ArcIntern<[T]>

source§

fn eq(&self, other: &&'a [T]) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &&'a [T]) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static, const N: usize> PartialEq<&[T; N]> for ArcIntern<[T]>

source§

fn eq(&self, other: &&[T; N]) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &&[T; N]) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<&'a mut [T]> for ArcIntern<[T]>

source§

fn eq(&self, other: &&'a mut [T]) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &&'a mut [T]) -> bool

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

impl<'a> PartialEq<&'a str> for ArcIntern<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &&'a str) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<[T]> for ArcIntern<[T]>

source§

fn eq(&self, other: &[T]) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &[T]) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static, const N: usize> PartialEq<[T; N]> for ArcIntern<[T]>

source§

fn eq(&self, other: &[T; N]) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &[T; N]) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<Arc<[T]>> for ArcIntern<[T]>

source§

fn eq(&self, other: &Arc<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Arc<[T]>) -> bool

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

impl<'a> PartialEq<Arc<str>> for ArcIntern<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Arc<str>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for &'a [T]

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static, const N: usize> PartialEq<ArcIntern<[T]>> for &[T; N]

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for &'a mut [T]

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for [T]

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static, const N: usize> PartialEq<ArcIntern<[T]>> for [T; N]

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for Arc<[T]>

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for Box<[T]>

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for Cow<'a, [T]>

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for Rc<[T]>

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<ArcIntern<[T]>> for Vec<T>

source§

fn eq(&self, other: &ArcIntern<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<[T]>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for &'a str

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for Arc<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for Box<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for Cow<'a, str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for Rc<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for String

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a> PartialEq<ArcIntern<str>> for str

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcIntern<str>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<Box<[T]>> for ArcIntern<[T]>

source§

fn eq(&self, other: &Box<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Box<[T]>) -> bool

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

impl<'a> PartialEq<Box<str>> for ArcIntern<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Box<str>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<Cow<'a, [T]>> for ArcIntern<[T]>

source§

fn eq(&self, other: &Cow<'a, [T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Cow<'a, [T]>) -> bool

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

impl<'a> PartialEq<Cow<'a, str>> for ArcIntern<str>

source§

fn eq(&self, other: &Cow<'a, str>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Cow<'a, str>) -> bool

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<Rc<[T]>> for ArcIntern<[T]>

source§

fn eq(&self, other: &Rc<[T]>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Rc<[T]>) -> bool

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

impl<'a> PartialEq<Rc<str>> for ArcIntern<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Rc<str>) -> bool

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

impl<'a> PartialEq<String> for ArcIntern<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

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

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

impl<'a, T: Copy + Send + Sync + Hash + Eq + 'static> PartialEq<Vec<T>> for ArcIntern<[T]>

source§

fn eq(&self, other: &Vec<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &Vec<T>) -> bool

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

impl<'a> PartialEq<str> for ArcIntern<str>

source§

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

This method tests for self and other values to be equal, and is used by ==.
source§

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

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

impl<T: ?Sized + Eq + Hash + Send + Sync> PartialEq for ArcIntern<T>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl<T: ?Sized + Eq + Hash + Send + Sync + PartialOrd> PartialOrd for ArcIntern<T>

source§

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

This method returns an ordering between self and other values if one exists. Read more
source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

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

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

impl<T: ?Sized + Eq + Hash + Send + Sync> Pointer for ArcIntern<T>

source§

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

Formats the value using the given formatter.
source§

impl<T: ?Sized + Eq + Hash + Send + Sync + Serialize> Serialize for ArcIntern<T>

Available on crate feature serde only.
source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl<T: ?Sized + Eq + Hash + Send + Sync> Eq for ArcIntern<T>

source§

impl<T: ?Sized + Eq + Hash + Send + Sync> Send for ArcIntern<T>

source§

impl<T: ?Sized + Eq + Hash + Send + Sync> Sync for ArcIntern<T>

Auto Trait Implementations§

§

impl<T> Freeze for ArcIntern<T>
where T: ?Sized,

§

impl<T> RefUnwindSafe for ArcIntern<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Unpin for ArcIntern<T>
where T: ?Sized,

§

impl<T> UnwindSafe for ArcIntern<T>
where T: RefUnwindSafe + ?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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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

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

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
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<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,