[−][src]Struct abi_stable::std_types::map::RHashMap
An ffi-safe hashmap,which wraps std::collections::HashMap<K,V,S>
,
only requiring the K: Eq + Hash
bounds when constructing it.
Most of the API in HashMap
is implemented here,including the Entry API.
Example
This example demonstrates how one can use the RHashMap as a dictionary.
use abi_stable::std_types::{RHashMap,Tuple2,RString,RSome}; let mut map=RHashMap::new(); map.insert("dictionary","A book/document containing definitions of words"); map.insert("bibliophile","Someone who loves books."); map.insert("pictograph","A picture representating of a word."); assert_eq!( map["dictionary"], "A book/document containing definitions of words", ); assert_eq!( map.remove("bibliophile"), RSome("Someone who loves books."), ); assert_eq!( map.get("pictograph"), Some(&"A picture representating of a word."), ); for Tuple2(k,v) in map { assert!( k=="dictionary" || k=="pictograph" ); assert!( v=="A book/document containing definitions of words" || v=="A picture representating of a word.", "{}=>{}", k,v ); }
Implementations
impl<K, V> RHashMap<K, V, RandomState>
[src]
pub fn new() -> RHashMap<K, V> where
Self: Default,
[src]
Self: Default,
Constructs an empty RHashMap.
Example
use abi_stable::std_types::{RHashMap,RString}; let mut map=RHashMap::<RString,u32>::new(); assert!(map.is_empty()); map.insert("Hello".into(),10); assert_eq!(map.is_empty(),false);
pub fn with_capacity(capacity: usize) -> RHashMap<K, V> where
Self: Default,
[src]
Self: Default,
Constructs an empty RHashMap with at least the passed capacity.
Example
use abi_stable::std_types::{RHashMap,RString}; let mut map=RHashMap::<RString,u32>::with_capacity(10); assert!(map.capacity()>=10);
impl<K, V, S> RHashMap<K, V, S>
[src]
pub fn with_hasher(hash_builder: S) -> RHashMap<K, V, S> where
K: Eq + Hash,
S: BuildHasher + Default,
[src]
K: Eq + Hash,
S: BuildHasher + Default,
Constructs an empty RHashMap with the passed hash_builder
to hash the keys.
Example
use abi_stable::std_types::{RHashMap,RString}; use std::collections::hash_map::RandomState; let s = RandomState::new(); let mut map=RHashMap::<RString,u32,_>::with_hasher(s); assert!(map.is_empty()); map.insert("Hello".into(),10); assert_eq!(map.is_empty(),false);
pub fn with_capacity_and_hasher(
capacity: usize,
hash_builder: S
) -> RHashMap<K, V, S> where
K: Eq + Hash,
S: BuildHasher + Default,
[src]
capacity: usize,
hash_builder: S
) -> RHashMap<K, V, S> where
K: Eq + Hash,
S: BuildHasher + Default,
Constructs an empty RHashMap with at least the passed capacity,
and the passed hash_builder
to hash the keys.
Example
use abi_stable::std_types::{RHashMap,RString}; use std::collections::hash_map::RandomState; let s = RandomState::new(); let mut map=RHashMap::<RString,u32,_>::with_capacity_and_hasher(10,s); assert!(map.capacity()>=10);
impl<K, V, S> RHashMap<K, V, S>
[src]
pub fn contains_key<Q: ?Sized>(&self, query: &Q) -> bool where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
Returns whether the map associates a value with the key.
Example
use abi_stable::std_types::{RHashMap,RString}; let mut map=RHashMap::<RString,u32>::new(); assert_eq!(map.contains_key("boo"),false); map.insert("boo".into(),0); assert_eq!(map.contains_key("boo"),true);
pub fn get<Q: ?Sized>(&self, query: &Q) -> Option<&V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
Returns a reference to the value associated with the key.
Returns a None
if there is no entry for the key.
Example
use abi_stable::std_types::{RHashMap,RString}; let mut map=RHashMap::<RString,u32>::new(); assert_eq!(map.get("boo"), None); map.insert("boo".into(),0); assert_eq!(map.get("boo"), Some(&0));
pub fn get_mut<Q: ?Sized>(&mut self, query: &Q) -> Option<&mut V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
Returns a mutable reference to the value associated with the key.
Returns a None
if there is no entry for the key.
Example
use abi_stable::std_types::{RHashMap,RString}; let mut map=RHashMap::<RString,u32>::new(); assert_eq!(map.get_mut("boo"), None); map.insert("boo".into(),0); assert_eq!(map.get_mut("boo"), Some(&mut 0));
pub fn remove<Q: ?Sized>(&mut self, query: &Q) -> ROption<V> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
Removes the value associated with the key.
Example
use abi_stable::std_types::{RHashMap,RSome,RNone}; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.remove(&0), RSome(1)); assert_eq!(map.remove(&0), RNone); assert_eq!(map.remove(&3), RSome(4)); assert_eq!(map.remove(&3), RNone);
pub fn remove_entry<Q: ?Sized>(&mut self, query: &Q) -> ROption<Tuple2<K, V>> where
K: Borrow<Q>,
Q: Hash + Eq,
[src]
K: Borrow<Q>,
Q: Hash + Eq,
Removes the entry for the key.
Example
use abi_stable::std_types::{RHashMap,RSome,RNone,Tuple2}; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.remove_entry(&0), RSome(Tuple2(0,1))); assert_eq!(map.remove_entry(&0), RNone); assert_eq!(map.remove_entry(&3), RSome(Tuple2(3,4))); assert_eq!(map.remove_entry(&3), RNone);
impl<K, V, S> RHashMap<K, V, S>
[src]
pub fn contains_key_p(&self, key: &K) -> bool
[src]
Returns whether the map associates a value with the key.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.contains_key(&11),false); map.insert(11,0); assert_eq!(map.contains_key(&11),true);
pub fn get_p(&self, key: &K) -> Option<&V>
[src]
Returns a reference to the value associated with the key.
Returns a None
if there is no entry for the key.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.get(&12), None); map.insert(12,0); assert_eq!(map.get(&12), Some(&0));
pub fn get_mut_p(&mut self, key: &K) -> Option<&mut V>
[src]
Returns a mutable reference to the value associated with the key.
Returns a None
if there is no entry for the key.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.get_mut(&12), None); map.insert(12,0); assert_eq!(map.get_mut(&12), Some(&mut 0));
pub fn remove_p(&mut self, key: &K) -> ROption<V>
[src]
Removes the value associated with the key.
Example
use abi_stable::std_types::{RHashMap,RSome,RNone}; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.remove_p(&0), RSome(1)); assert_eq!(map.remove_p(&0), RNone); assert_eq!(map.remove_p(&3), RSome(4)); assert_eq!(map.remove_p(&3), RNone);
pub fn remove_entry_p(&mut self, key: &K) -> ROption<Tuple2<K, V>>
[src]
Removes the entry for the key.
Example
use abi_stable::std_types::{RHashMap,RSome,RNone,Tuple2}; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.remove_entry_p(&0), RSome(Tuple2(0,1))); assert_eq!(map.remove_entry_p(&0), RNone); assert_eq!(map.remove_entry_p(&3), RSome(Tuple2(3,4))); assert_eq!(map.remove_entry_p(&3), RNone);
pub fn index_p(&self, key: &K) -> &V
[src]
Returns a reference to the value associated with the key.
Panics
Panics if the key is not associated with a value.
Example
use abi_stable::std_types::RHashMap; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.index_p(&0),&1); assert_eq!(map.index_p(&3),&4);
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.index_p(&0),&1);
pub fn index_mut_p(&mut self, key: &K) -> &mut V
[src]
Returns a mutable reference to the value associated with the key.
Panics
Panics if the key is not associated with a value.
Example
use abi_stable::std_types::RHashMap; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.index_mut_p(&0),&mut 1); assert_eq!(map.index_mut_p(&3),&mut 4);
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.index_mut_p(&0),&mut 1);
pub fn insert(&mut self, key: K, value: V) -> ROption<V>
[src]
Inserts a value into the map,associating it with a key,returning the previous value.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); map.insert(0,1); map.insert(2,3); assert_eq!(map[&0],1); assert_eq!(map[&2],3);
pub fn reserve(&mut self, reserved: usize)
[src]
Reserves enough space to insert reserved
extra elements without reallocating.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); map.reserve(10);
pub fn clear(&mut self)
[src]
Removes all the entries in the map.
Example
use abi_stable::std_types::RHashMap; let mut map=vec![(0,1),(3,4)].into_iter().collect::<RHashMap<u32,u32>>(); assert_eq!(map.contains_key(&0),true); assert_eq!(map.contains_key(&3),true); map.clear(); assert_eq!(map.contains_key(&0),false); assert_eq!(map.contains_key(&3),false);
pub fn len(&self) -> usize
[src]
Returns the amount of entries in the map.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.len(),0); map.insert(0,1); assert_eq!(map.len(),1); map.insert(2,3); assert_eq!(map.len(),2);
pub fn capacity(&self) -> usize
[src]
Returns the capacity of the map,the amount of elements it can store without reallocating.
Note that this is a lower bound,since hash maps don't necessarily have an exact capacity.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::with_capacity(4); assert!(map.capacity()>=4);
pub fn is_empty(&self) -> bool
[src]
Returns whether the map contains any entries.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); assert_eq!(map.is_empty(),true); map.insert(0,1); assert_eq!(map.is_empty(),false);
pub fn iter(&self) -> Iter<'_, K, V>
[src]
Iterates over the entries in the map,with references to the values in the map.
This returns a type that implements
Iterator<Item= Tuple2< &K, &V > > + !Send + !Sync + Clone
Example
use abi_stable::std_types::{RHashMap,Tuple2}; let mut map=RHashMap::<u32,u32>::new(); map.insert(0,1); map.insert(3,4); let mut list=map.iter().collect::<Vec<_>>(); list.sort(); assert_eq!( list, vec![Tuple2(&0,&1),Tuple2(&3,&4)] );
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>
[src]
Iterates over the entries in the map,with mutable references to the values in the map.
This returns a type that implements
Iterator<Item= Tuple2< &K, &mut V > > + !Send + !Sync
Example
use abi_stable::std_types::{RHashMap,Tuple2}; let mut map=RHashMap::<u32,u32>::new(); map.insert(0,1); map.insert(3,4); let mut list=map.iter_mut().collect::<Vec<_>>(); list.sort(); assert_eq!( list, vec![Tuple2(&0,&mut 1),Tuple2(&3,&mut 4)] );
pub fn drain(&mut self) -> Drain<'_, K, V>
[src]
Clears the map,returning an iterator over all the entries that were removed.
This returns a type that implements Iterator<Item= Tuple2< K, V > > + !Send + !Sync
Example
use abi_stable::std_types::{RHashMap,Tuple2}; let mut map=RHashMap::<u32,u32>::new(); map.insert(0,1); map.insert(3,4); let mut list=map.drain().collect::<Vec<_>>(); list.sort(); assert_eq!( list, vec![Tuple2(0,1),Tuple2(3,4)] ); assert!(map.is_empty());
pub fn entry(&mut self, key: K) -> REntry<'_, K, V>
[src]
Gets a handle into the entry in the map for the key, that allows operating directly on the entry.
Example
use abi_stable::std_types::RHashMap; let mut map=RHashMap::<u32,u32>::new(); // Inserting an entry that wasn't there before. { let mut entry=map.entry(0); assert_eq!(entry.get(),None); assert_eq!(entry.or_insert(3),&mut 3); assert_eq!(map.get(&0),Some(&3)); }
Trait Implementations
impl<K, V, S> Clone for RHashMap<K, V, S> where
K: Clone,
V: Clone,
Self: Default,
[src]
K: Clone,
V: Clone,
Self: Default,
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<K, V, S> Debug for RHashMap<K, V, S> where
K: Debug,
V: Debug,
[src]
K: Debug,
V: Debug,
impl<K, V, S> Default for RHashMap<K, V, S> where
K: Eq + Hash,
S: BuildHasher + Default,
[src]
K: Eq + Hash,
S: BuildHasher + Default,
impl<'de, K, V, S> Deserialize<'de> for RHashMap<K, V, S> where
K: Deserialize<'de>,
V: Deserialize<'de>,
Self: Default,
[src]
K: Deserialize<'de>,
V: Deserialize<'de>,
Self: Default,
pub fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl<K, V, S> Eq for RHashMap<K, V, S> where
K: Eq,
V: Eq,
[src]
K: Eq,
V: Eq,
impl<K, V, S> Extend<(K, V)> for RHashMap<K, V, S>
[src]
pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = (K, V)>,
[src]
I: IntoIterator<Item = (K, V)>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<K, V, S> Extend<Tuple2<K, V>> for RHashMap<K, V, S>
[src]
pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Tuple2<K, V>>,
[src]
I: IntoIterator<Item = Tuple2<K, V>>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<K, V, S> From<HashMap<K, V, S>> for RHashMap<K, V, S> where
Self: Default,
[src]
Self: Default,
impl<K, V, S> FromIterator<(K, V)> for RHashMap<K, V, S> where
Self: Default,
[src]
Self: Default,
pub fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = (K, V)>,
[src]
I: IntoIterator<Item = (K, V)>,
impl<K, V, S> FromIterator<Tuple2<K, V>> for RHashMap<K, V, S> where
Self: Default,
[src]
Self: Default,
pub fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Tuple2<K, V>>,
[src]
I: IntoIterator<Item = Tuple2<K, V>>,
impl<K, V, S> GetStaticEquivalent_ for RHashMap<K, V, S> where
K: __StableAbi,
V: __StableAbi,
[src]
K: __StableAbi,
V: __StableAbi,
type StaticEquivalent = _static_RHashMap<__GetStaticEquivalent<K>, __GetStaticEquivalent<V>, ()>
impl<K, Q: ?Sized, V, S, '_> Index<&'_ Q> for RHashMap<K, V, S> where
K: Borrow<Q>,
Q: Eq + Hash,
[src]
K: Borrow<Q>,
Q: Eq + Hash,
impl<K, Q: ?Sized, V, S, '_> IndexMut<&'_ Q> for RHashMap<K, V, S> where
K: Borrow<Q>,
Q: Eq + Hash,
[src]
K: Borrow<Q>,
Q: Eq + Hash,
impl<K, V, S> Into<HashMap<K, V, S>> for RHashMap<K, V, S> where
K: Eq + Hash,
S: BuildHasher + Default,
[src]
K: Eq + Hash,
S: BuildHasher + Default,
impl<K, V, S> IntoIterator for RHashMap<K, V, S>
[src]
This returns an Iterator<Item= Tuple2< K, V > >+!Send+!Sync
type Item = Tuple2<K, V>
The type of the elements being iterated over.
type IntoIter = IntoIter<K, V>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> IntoIter<K, V>ⓘ
[src]
impl<'a, K, V, S> IntoIterator for &'a RHashMap<K, V, S>
[src]
This returns an Iterator<Item= Tuple2< &K, &V > > + !Send + !Sync + Clone
type Item = Tuple2<&'a K, &'a V>
The type of the elements being iterated over.
type IntoIter = Iter<'a, K, V>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, K, V, S> IntoIterator for &'a mut RHashMap<K, V, S>
[src]
This returns a type that implements
Iterator<Item= Tuple2< &K, &mut V > > + !Send + !Sync
type Item = Tuple2<&'a K, &'a mut V>
The type of the elements being iterated over.
type IntoIter = IterMut<'a, K, V>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl<K, V, S> PartialEq<RHashMap<K, V, S>> for RHashMap<K, V, S> where
K: PartialEq,
V: PartialEq,
[src]
K: PartialEq,
V: PartialEq,
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<K, V, S> Send for RHashMap<K, V, S> where
HashMap<K, V, S>: Send,
[src]
HashMap<K, V, S>: Send,
impl<K, V, S> Serialize for RHashMap<K, V, S> where
K: Serialize,
V: Serialize,
[src]
K: Serialize,
V: Serialize,
impl<K, V, S> StableAbi for RHashMap<K, V, S> where
K: __StableAbi,
V: __StableAbi,
[src]
K: __StableAbi,
V: __StableAbi,
type IsNonZeroType = False
Whether this type has a single invalid bit-pattern. Read more
pub const LAYOUT: &'static TypeLayout
[src]
pub const ABI_CONSTS: AbiConsts
[src]
impl<K, V, S> Sync for RHashMap<K, V, S> where
HashMap<K, V, S>: Sync,
[src]
HashMap<K, V, S>: Sync,
Auto Trait Implementations
impl<K, V, S> RefUnwindSafe for RHashMap<K, V, S> where
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, S> Unpin for RHashMap<K, V, S>
impl<K, V, S> UnwindSafe for RHashMap<K, V, S> where
K: RefUnwindSafe + UnwindSafe,
S: RefUnwindSafe + UnwindSafe,
V: RefUnwindSafe + UnwindSafe,
K: RefUnwindSafe + UnwindSafe,
S: RefUnwindSafe + UnwindSafe,
V: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> BorrowOwned<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
type ROwned = T
The owned type, stored in RCow::Owned
type RBorrowed = &'a T
The borrowed type, stored in RCow::Borrowed
pub fn r_borrow(
&'a <T as BorrowOwned<'a>>::ROwned
) -> <T as BorrowOwned<'a>>::RBorrowed
[src]
&'a <T as BorrowOwned<'a>>::ROwned
) -> <T as BorrowOwned<'a>>::RBorrowed
pub fn r_to_owned(
<T as BorrowOwned<'a>>::RBorrowed
) -> <T as BorrowOwned<'a>>::ROwned
[src]
<T as BorrowOwned<'a>>::RBorrowed
) -> <T as BorrowOwned<'a>>::ROwned
pub fn deref_borrowed(&<T as BorrowOwned<'a>>::RBorrowed) -> &T
[src]
pub fn deref_owned(&<T as BorrowOwned<'a>>::ROwned) -> &T
[src]
pub fn from_cow_borrow(&'a T) -> <T as BorrowOwned<'a>>::RBorrowed
[src]
pub fn from_cow_owned(<T as ToOwned>::Owned) -> <T as BorrowOwned<'a>>::ROwned
[src]
pub fn into_cow_borrow(<T as BorrowOwned<'a>>::RBorrowed) -> &'a T
[src]
pub fn into_cow_owned(<T as BorrowOwned<'a>>::ROwned) -> <T as ToOwned>::Owned
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> GetWithMetadata for T
[src]
type ForSelf = WithMetadata_<T, T>
This is always WithMetadata_<Self, Self>
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SelfOps for T where
T: ?Sized,
[src]
T: ?Sized,
pub const T: PhantomData<fn() -> Self>
[src]
pub const T_D: PhantomData<Self>
[src]
pub fn assert_ty(self, _other: PhantomData<fn() -> Self>) -> Self
[src]
pub fn assert_ty_ref(&self, _other: PhantomData<fn() -> Self>) -> &Self
[src]
pub fn assert_ty_mut(&mut self, _other: PhantomData<fn() -> Self>) -> &mut Self
[src]
pub fn ty_(&self) -> PhantomData<fn() -> Self>
[src]
pub fn ty_d(&self) -> PhantomData<Self>
[src]
pub fn ty_inv(&self) -> PhantomData<fn(Self) -> Self>
[src]
pub fn ty_inv_ref(&self) -> PhantomData<Cell<&Self>>
[src]
pub fn eq_id(&self, other: &Self) -> bool
[src]
pub fn piped<F, U>(self, f: F) -> U where
F: FnOnce(Self) -> U,
[src]
F: FnOnce(Self) -> U,
pub fn piped_ref<'a, F, U>(&'a self, f: F) -> U where
F: FnOnce(&'a Self) -> U,
[src]
F: FnOnce(&'a Self) -> U,
pub fn piped_mut<'a, F, U>(&'a mut self, f: F) -> U where
F: FnOnce(&'a mut Self) -> U,
[src]
F: FnOnce(&'a mut Self) -> U,
pub fn mutated<F>(self, f: F) -> Self where
F: FnOnce(&mut Self),
[src]
F: FnOnce(&mut Self),
pub fn observe<F>(self, f: F) -> Self where
F: FnOnce(&Self),
[src]
F: FnOnce(&Self),
pub fn into_<T>(self, PhantomData<fn() -> T>) -> T where
Self: Into<T>,
[src]
Self: Into<T>,
pub fn as_ref_<T>(&self) -> &T where
Self: AsRef<T>,
T: ?Sized,
[src]
Self: AsRef<T>,
T: ?Sized,
pub fn as_mut_<T>(&mut self) -> &mut T where
Self: AsMut<T>,
T: ?Sized,
[src]
Self: AsMut<T>,
T: ?Sized,
pub fn drop_(self)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<This> TransmuteElement for This where
This: ?Sized,
[src]
This: ?Sized,
pub unsafe fn transmute_element<T>(self) -> Self::TransmutedPtr where
Self: CanTransmuteElement<T>,
Self::Target: Sized,
[src]
Self: CanTransmuteElement<T>,
Self::Target: Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The error type returned when the conversion fails.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> TypeIdentity for T where
T: ?Sized,
[src]
T: ?Sized,
type Type = T
The same type as Self. Read more
pub fn into_type_val(self) -> Self::Type where
Self::Type: Sized,
[src]
Self::Type: Sized,
pub fn into_type_ref(&self) -> &Self::Type
[src]
pub fn into_type_mut(&mut self) -> &mut Self::Type
[src]
pub fn into_type_box(self: Box<Self, Global>) -> Box<Self::Type, Global>
[src]
pub fn into_type_arc(this: Arc<Self>) -> Arc<Self::Type>
[src]
pub fn into_type_rc(this: Rc<Self>) -> Rc<Self::Type>
[src]
pub fn from_type_val(this: Self::Type) -> Self where
Self::Type: Sized,
[src]
Self::Type: Sized,
pub fn from_type_ref(this: &Self::Type) -> &Self
[src]
pub fn from_type_mut(this: &mut Self::Type) -> &mut Self
[src]
pub fn from_type_box(this: Box<Self::Type, Global>) -> Box<Self, Global>
[src]
pub fn from_type_arc(this: Arc<Self::Type>) -> Arc<Self>
[src]
pub fn from_type_rc(this: Rc<Self::Type>) -> Rc<Self>
[src]
impl<This> ValidTag_Bounds for This where
This: Debug + Clone + PartialEq<This>,
[src]
This: Debug + Clone + PartialEq<This>,