DataCloud

Struct DataCloud 

Source
pub struct DataCloud<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq, S = FxBuildHasher> { /* private fields */ }
Expand description

An abstract data structure can store values without moving them.

§Examples

use cloudr::DataCloud;
 
let data: DataCloud<'_, String, String> = DataCloud::new();
let x = "Hello master".to_string();
let y = String::from("hello, world!");
data.insert("x".to_string(), &x);
data.insert("y".to_string(), &y);
 
assert_eq!(&y, data.get(&"y".to_string()).unwrap());

Implementations§

Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> DataCloud<'a, K, V>

Source

pub fn new() -> DataCloud<'a, K, V>

Returns a new instance of a DataCloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
Source

pub fn insert(&self, key: K, value: &'a V) -> Option<&'a V>

Inserts a new key into the cloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
let inserted_before: Option<&i32> = cloud.insert("y".to_string(), &y);
 
Source

pub fn or_insert(&self, key: K, value: &'a V) -> bool

Inserts a new key into the cloud if the key doesn’t already exist, and returns whether the key was inserted or not.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.or_insert("y".to_string(), &y);
Source

pub fn get(&self, key_to_search_for: &K) -> Option<&'a V>

Gets the reference stored in the cloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let y_ref: Option<&i32> = cloud.get(&"y".to_string());
assert_eq!(&y, y_ref.unwrap());
Source

pub fn get_mut(&self, key_to_search_for: &K) -> Option<&'a mut V>

Gets the reference stored in the cloud as a mutable reference.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let mut y = 3;
cloud.insert("y".to_string(), &mut y);
 
 
let y_ref: Option<&mut i32> = cloud.get_mut(&"y".to_string());
Source

pub fn remove(&self, key: &K) -> Option<&'a V>

Removes the reference stored in the cloud and returns it if it exists.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let mut y = 3;
cloud.insert("y".to_string(), &mut y);
 
let y_ref = cloud.remove(&"y".to_string()).unwrap();
Source

pub fn merge_in_place(&self, other: DataCloud<'a, K, V>)

Merges in place the DataCloud with the other one by consuming the other DataCloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let cloud2: DataCloud<'_, String, i32> = DataCloud::new();
let x = 56;
cloud2.insert("x".to_string(), &x);
 
cloud.merge_in_place(cloud2);
Source

pub fn merge_with(self, other: &DataCloud<'a, K, V>)

Merges in place the other DataCloud with this one by consuming this DataCloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let cloud2: DataCloud<'_, String, i32> = DataCloud::new();
let x = 56;
cloud2.insert("x".to_string(), &x);
 
cloud2.merge_with(&cloud);
 
println!("{:?}", cloud);
Source

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

Returns if the cloud contains a reference indexed by this key.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let mut x = 63;
cloud.insert("x".to_string(), &mut x);
 
assert!(cloud.contains_key(&"x".to_string()));
Source

pub fn contains_value(&self, key: &V) -> bool

Returns if the cloud contains the specified reference as a value.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let x = 63;
cloud.insert("x".to_string(), &x);
 
assert!(cloud.contains_value(&x));
Source

pub fn is_empty(&self) -> bool

Returns if the cloud does not contain any key-value pairs.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
assert!(cloud.is_empty());
Source

pub fn into_pairs(self) -> IntoPairs<K, &'a V>

Returns the cloud into an iterator of (K, &'a V) key-value pairs in arbitrary order.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let mut x = 63;
cloud.insert("x".to_string(), &mut x);
 
for (key, value) in cloud.into_pairs() {
    println!("({key}: {value})");
}
Source

pub unsafe fn into_raw_pairs(self) -> IntoPairs<K, *mut V>

Returns the cloud into an iterator of (K, *mut V) key-value pairs in arbitrary order.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let mut x = 63;
cloud.insert("x".to_string(), &mut x);
 
for (key, value) in cloud.into_pairs() {
    println!("({key}: {})", *value);
}
Source

pub fn clear(&self)

Clears the DataCloud’s key-value pairs into a fresh, new one.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, usize, i128> = DataCloud::new();
 
let v = 54;
 
cloud.insert(3, &v);
 
cloud.clear();
 
assert_eq!(DataCloud::new(), cloud);
Source

pub unsafe fn insert_from_raw( &self, key: K, value: *const V, ) -> Result<Option<&'a V>, NullPointerError>

Inserts a new key into the cloud from a raw pointer

§Examples
use cloudr::DataCloud;
use cloudr::error::NullPointerError;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
let inserted_before: Result<Option<&i32>, NullPointerError> = unsafe {
    cloud.insert_from_raw("y".to_string(), &y as *const i32)
};
 
Source

pub unsafe fn get_as_raw(&self, key_to_search_for: &K) -> Option<*mut V>

Gets the reference stored in the cloud as a mutable raw pointer.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let pointer: Option<*mut i32> = unsafe {
    cloud.get_as_raw(&"y".to_string())
};
Source

pub fn from_hashmap(hashmap: FxHashMap<K, &'a V>) -> DataCloud<'a, K, V>

Builds a new DataCloud from a FxHashMap<K, &'a V>.

§Examples
use cloudr::DataCloud;
use fxhash::FxHashMap;
 
let mut map: FxHashMap<String, &i32> = FxHashMap::default();
let y = 3;
map.insert("y".to_string(), &y);
 
let cloud = DataCloud::from_hashmap(map);
Source

pub fn map<F>(&self, f: F) -> Map<K, V>
where F: Fn((&K, &&'a V)) -> (K, V),

Calls a function for each key-value pair of the cloud and returns an iterator over the resulted pairs.

§Examples
use cloudr::DataCloud;
use cloudr::iter::Map;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let iterator: Map<String, i32> = cloud.map(|(k, v)| { return ( k.to_uppercase(), **v - 1 ) });
Source

pub fn iter(&'a self) -> Iter<'a, K, V>

Returns an iterator over the elements of the cloud as &'a references.

§Examples
use cloudr::DataCloud;
use cloudr::iter::Iter;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let mut iterator: Iter<'_, String, i32> = cloud.iter();
 
assert_eq!((&"y".to_string(), &&3), iterator.next().unwrap());
Source

pub fn iter_mut(&'a self) -> IterMut<'a, K, V>

Returns an iterator over the elements of the cloud as &'a mut references.

§Examples
use cloudr::DataCloud;
use cloudr::iter::IterMut;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let mut iterator: IterMut<'_, String, i32> = cloud.iter_mut();
 
assert_eq!((&"y".to_string(), &mut &3), iterator.next().unwrap());
Source

pub fn into_vec(self) -> Vec<(K, &'a V)>

Consumes the DataCloud and returns a vector of tuples containing (K, &'a V).

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let mut vec: Vec<(String, &i32)> = cloud.into_vec();
assert_eq!(vec, vec![("y".to_string(), &y)]);
Source

pub fn into_vecdeque(self) -> VecDeque<(K, &'a V)>

Consumes the DataCloud and returns a VecDeque of tuples containing (K, &'a V).

§Examples
use cloudr::DataCloud;
use std::collections::VecDeque;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let mut vec: VecDeque<(String, &i32)> = cloud.into_vecdeque();
Source

pub fn insert_all(&self, pairs: Vec<(K, &'a V)>) -> Vec<Option<&'a V>>

Inserts multiple elements at a time in the DataCloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let x = 42;
let y = 24;
 
let pairs: Vec<(String, &i32)> = vec![("x".to_string(), &x), ("y".to_string(), &y)];
cloud.insert_all(pairs);
Source

pub fn get_all(&self, keys: Vec<&K>) -> Vec<Option<&'a V>>

Gets multiple elements at a time in the DataCloud.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let x = 42;
let y = 24;
 
let x_string = "x".to_string();
let y_string = "y".to_string();
 
cloud.insert("x".to_string(), &x);
cloud.insert("y".to_string(), &y);
 
let pairs = vec![&x_string, &y_string];
 
assert_eq!(cloud.get_all(pairs), vec![Some(&x), Some(&y)])
Source

pub fn get_mut_all(&self, keys: Vec<&K>) -> Vec<Option<&'a mut V>>

Gets multiple elements at a time in the DataCloud as mutable references.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let mut x = 42;
let mut y = 24;
 
let x_string = "x".to_string();
let y_string = "y".to_string();
 
cloud.insert("x".to_string(), &x);
cloud.insert("y".to_string(), &y);
 
let pairs = vec![&x_string, &y_string];
 
let mut_pairs: Vec<Option<&mut i32>> = cloud.get_mut_all(pairs);
Source

pub fn as_ptr(&self) -> *const DataCloud<'a, K, V>

Returns the DataCloud as a constant pointer to a DataCloud<'a, K, V>.

§Examples
use cloudr::DataCloud;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let pointer: *const DataCloud<'_, String, i32> = cloud.as_ptr();
Source

pub fn as_boxed_ref(&self) -> Box<&FxHashMap<K, &'a V>>

Returns the DataCloud’s inner HashMap as a boxed shared reference Box<&HashMap<K, &'a V, S>.

§Examples
use cloudr::DataCloud;
use fxhash::FxHashMap;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let boxed_ref: Box<&FxHashMap<String, &i32>> = cloud.as_boxed_ref();
Source

pub unsafe fn as_boxed_ptr(&self) -> Box<*const FxHashMap<K, &'a V>>

Returns the DataCloud’s inner HashMap as a boxed raw pointer Box<*const HashMap<K, &'a V, S>.

§Examples
use cloudr::DataCloud;
use fxhash::FxHashMap;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let boxed_ptr: Box<*const FxHashMap<String, &i32>> = unsafe {
    cloud.as_boxed_ptr()
};
Source

pub unsafe fn as_boxed_mut(&self) -> Box<&mut FxHashMap<K, &'a V>>

Returns the DataCloud’s inner HashMap as a boxed mutable reference Box<&mut HashMap<K, &'a V, S>.

§Examples
use cloudr::DataCloud;
use fxhash::FxHashMap;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
 
let boxed_ref: Box<&mut FxHashMap<String, &i32>> = unsafe {
    cloud.as_boxed_mut()
};
Source

pub fn retain<F>(&self, predicate: F)
where F: FnMut(&K, &&'a V) -> bool,

Retains only the elements specified by the predicate function.

§Examples
use cloudr::DataCloud;

let cloud: DataCloud<String, i32> = DataCloud::new();
cloud.insert("x".to_string(), &42);
cloud.insert("y".to_string(), &24);

cloud.retain(|key, value| {
    *value > &30
});

assert!(cloud.contains_key(&"x".to_string()));
assert!(!cloud.contains_key(&"y".to_string()));
Source

pub fn from_vec<T: Into<Vec<(K, &'a V)>>>(vec: T) -> Self

Returns a new DataCloud from the given vector of keys and values Vec<(K, &'a V)>.

§Examples
use cloudr::DataCloud;

let mut vector = Vec::new();
vector.push((String::from("Banana"), &1));
 
let cloud: DataCloud<'_, String, i32> = DataCloud::from_vec(vector);
Source§

impl<'a, K: PartialEq + Eq + Hash + Clone, V: PartialEq + Eq + Clone> DataCloud<'a, K, V>

Source

pub fn merge(&self, other: &DataCloud<'a, K, V>) -> DataCloud<'a, K, V>

Merges the DataCloud with another and returns the resulting one. The other DataCloud will always have priority. So, if there are two conflicting keys, the other one will always have priority.

§Examples
use cloudr::DataCloud;

let cloud: DataCloud<String, i32> = DataCloud::new();
cloud.insert("x".to_string(), &42);
cloud.insert("y".to_string(), &24);

let cloud2: DataCloud<String, i32> = DataCloud::new();
cloud2.insert("z".to_string(), &64);
 
assert!(cloud.merge(&cloud2).contains_key(&"z".to_string()));
Source

pub fn merge_all( &self, others: Vec<&DataCloud<'a, K, V>>, ) -> DataCloud<'a, K, V>

Merges the DataCloud with other instances and returns the resulting one. The last element of the vector others will always have priority. So, if there are two conflicting keys, the last one will always have priority.

§Examples
use cloudr::DataCloud;

let cloud: DataCloud<String, i32> = DataCloud::new();
cloud.insert("x".to_string(), &42);
cloud.insert("y".to_string(), &24);

let cloud2: DataCloud<String, i32> = DataCloud::new();
cloud2.insert("z".to_string(), &64);
 
assert!(cloud.merge_all(vec![&cloud2]).contains_key(&"z".to_string()));

Trait Implementations§

Source§

impl<'a, K: PartialEq + Eq + Hash + Clone, V: PartialEq + Eq> Clone for DataCloud<'a, K, V>

Source§

fn clone(&self) -> Self

Returns a duplicate 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<'a, K: PartialEq + Eq + Hash + Clone, V: PartialEq + Eq> CombineWith for DataCloud<'a, K, V>

Source§

fn combine_with(&self, others: Vec<Self>) -> Self
where Self: Sized,

Enables the DataCloud to combine with other instances of the same type

§Examples
use cloudr::DataCloud;
use cloudr::CombineWith;
 
let cloud: DataCloud<'_, String, i32> = DataCloud::new();
let y = 3;
cloud.insert("y".to_string(), &y);
 
let cloud2: DataCloud<'_, String, i32> = DataCloud::new();
let x = 4;
cloud2.insert("x".to_string(), &x);
 
let final_cloud: DataCloud<'_, String, i32> = cloud.combine_with(vec![cloud2]);
 
let cloud3: DataCloud<'_, String, i32> = DataCloud::new();
cloud3.insert("y".to_string(), &y);
cloud3.insert("x".to_string(), &x);
 
assert_eq!(final_cloud, cloud3);
Source§

impl<'a, K: PartialEq + Eq + Hash + Clone + Debug, V: PartialEq + Eq + Debug> Debug for DataCloud<'a, K, V>

Source§

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

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

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Default for DataCloud<'a, K, V>

Source§

fn default() -> Self

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

impl<'a, K: PartialEq + Eq + Hash + Clone + Display, V: PartialEq + Eq + Display> Display for DataCloud<'a, K, V>

Source§

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

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

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Extend<(K, &'a V)> for DataCloud<'a, K, V>

Source§

fn extend<T: IntoIterator<Item = (K, &'a V)>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> From<HashMap<K, &'a V, BuildHasherDefault<FxHasher>>> for DataCloud<'a, K, V>

Source§

fn from(value: FxHashMap<K, &'a V>) -> Self

Converts to this type from the input type.
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> FromIterator<(K, &'a V)> for DataCloud<'a, K, V>

Source§

fn from_iter<T: IntoIterator<Item = (K, &'a V)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq + Hash> Hash for DataCloud<'a, K, V>

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, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Index<&K> for DataCloud<'a, K, V>

Source§

type Output = V

The returned type after indexing.
Source§

fn index(&self, index: &K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> IndexMut<&K> for DataCloud<'a, K, V>

Source§

fn index_mut(&mut self, index: &K) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Into<Vec<(K, &'a V)>> for DataCloud<'a, K, V>

Source§

fn into(self) -> Vec<(K, &'a V)>

Converts this type into the (usually inferred) input type.
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Into<VecDeque<(K, &'a V)>> for DataCloud<'a, K, V>

Source§

fn into(self) -> VecDeque<(K, &'a V)>

Converts this type into the (usually inferred) input type.
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> IntoIterator for DataCloud<'a, K, V>

Source§

type IntoIter = IntoIter<K, &'a V>

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

type Item = (K, &'a V)

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, K: PartialEq + Eq + Hash + Clone, V: PartialEq + Eq + Clone, S: BuildHasher + Default> IntoOwned<K, V, S> for DataCloud<'a, K, V>

Source§

fn into_owned(&self) -> HashMap<K, V, S>

Returns an owned form of the object. Read more
Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> PartialEq for DataCloud<'a, K, V>

Source§

fn eq(&self, other: &Self) -> 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<'a, K: PartialEq + Eq + Hash + PartialOrd, V: PartialEq + Eq + PartialOrd> PartialOrd for DataCloud<'a, K, V>

Source§

fn partial_cmp(&self, other: &Self) -> 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<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> !Copy for DataCloud<'a, K, V>

Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Eq for DataCloud<'a, K, V>

Source§

impl<'a, K: PartialEq + Eq + Hash, V: PartialEq + Eq> Send for DataCloud<'a, K, V>

Source§

impl<'a, K: PartialEq + Eq + Hash + Send + Sync, V: PartialEq + Eq + Send + Sync> Sync for DataCloud<'a, K, V>

Auto Trait Implementations§

§

impl<'a, K, V, S = BuildHasherDefault<FxHasher>> !Freeze for DataCloud<'a, K, V, S>

§

impl<'a, K, V, S = BuildHasherDefault<FxHasher>> !RefUnwindSafe for DataCloud<'a, K, V, S>

§

impl<'a, K, V, S = BuildHasherDefault<FxHasher>> !Send for DataCloud<'a, K, V, S>

§

impl<'a, K, V, S = BuildHasherDefault<FxHasher>> !Sync for DataCloud<'a, K, V, S>

§

impl<'a, K, V, S> Unpin for DataCloud<'a, K, V, S>
where S: Unpin, K: Unpin,

§

impl<'a, K, V, S> UnwindSafe for DataCloud<'a, K, V, S>

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