pub struct SingletonMap<V>(/* private fields */);Expand description
A map that uses types as keys and stores values of a single type V.
This data structure allows you to associate values with types as keys.
For example, you could map u8 to a String description, i8 to another
String description, etc., all within the same SingletonMap<String>.
§Examples
use singletons::SingletonMap;
let mut map: SingletonMap<String> = SingletonMap::new();
map.insert::<u8>("An unsigned 8-bit integer".to_string());
map.insert::<i8>("A signed 8-bit integer".to_string());
assert_eq!(map.get::<u8>(), Some(&"An unsigned 8-bit integer".to_string()));
assert_eq!(map.get::<i8>(), Some(&"A signed 8-bit integer".to_string()));Implementations§
Source§impl<V> SingletonMap<V>
impl<V> SingletonMap<V>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty SingletonMap.
The map is initially created with a capacity of 0, so it will not allocate until an element is inserted.
§Examples
use singletons::SingletonMap;
let mut map: SingletonMap<String> = SingletonMap::new();Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty SingletonMap with at least the specified capacity.
The map will be able to hold at least capacity elements without
reallocating.
§Examples
use singletons::SingletonMap;
let mut map: SingletonMap<String> = SingletonMap::with_capacity(10);Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the map can hold without reallocating.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of elements currently in the map.
Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements.
Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional more elements.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the map as much as possible.
Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Shrinks the capacity of the map as much as possible, but not less than
min_capacity.
Sourcepub fn insert<K: 'static>(&mut self, value: V) -> Option<V>
pub fn insert<K: 'static>(&mut self, value: V) -> Option<V>
Inserts a value into the map with the type K as the key.
If the map did not have this type as a key, None is returned.
If the map did have this type as a key, the value is updated and the
old value is returned.
§Examples
use singletons::SingletonMap;
let mut map = SingletonMap::new();
assert_eq!(map.insert::<u8>("first".to_string()), None);
assert_eq!(map.insert::<u8>("second".to_string()), Some("first".to_string()));Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Sourcepub fn get<K: 'static>(&self) -> Option<&V>
pub fn get<K: 'static>(&self) -> Option<&V>
Returns a reference to the value corresponding to the type key K.
§Examples
use singletons::SingletonMap;
let mut map = SingletonMap::new();
map.insert::<u8>("value".to_string());
assert_eq!(map.get::<u8>(), Some(&"value".to_string()));
assert_eq!(map.get::<i8>(), None);Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Sourcepub fn get_mut<K: 'static>(&mut self) -> Option<&mut V>
pub fn get_mut<K: 'static>(&mut self) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the type key K.
§Examples
use singletons::SingletonMap;
let mut map = SingletonMap::new();
map.insert::<u8>("value".to_string());
if let Some(v) = map.get_mut::<u8>() {
v.push_str(" modified");
}
assert_eq!(map.get::<u8>(), Some(&"value modified".to_string()));Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Sourcepub fn remove<K: 'static>(&mut self) -> Option<V>
pub fn remove<K: 'static>(&mut self) -> Option<V>
Removes a key-value pair from the map, returning the value if the
type key K was present.
§Examples
use singletons::SingletonMap;
let mut map = SingletonMap::new();
map.insert::<u8>("value".to_string());
assert_eq!(map.remove::<u8>(), Some("value".to_string()));
assert_eq!(map.remove::<u8>(), None);Sourcepub fn contains_key<K: 'static>(&self) -> bool
pub fn contains_key<K: 'static>(&self) -> bool
Returns true if the map contains a value for the specified type key K.
§Examples
use singletons::SingletonMap;
let mut map = SingletonMap::new();
map.insert::<u8>("value".to_string());
assert!(map.contains_key::<u8>());
assert!(!map.contains_key::<i8>());Sourcepub fn keys(&self) -> Keys<'_, V> ⓘ
pub fn keys(&self) -> Keys<'_, V> ⓘ
Returns an iterator visiting all type keys in insertion order.
Sourcepub fn values(&self) -> Values<'_, V> ⓘ
pub fn values(&self) -> Values<'_, V> ⓘ
Returns an iterator visiting all values in insertion order.
Sourcepub fn values_mut(&mut self) -> ValuesMut<'_, V> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_, V> ⓘ
Returns an iterator visiting all values mutably in insertion order.
Sourcepub fn iter(&self) -> Iter<'_, V> ⓘ
pub fn iter(&self) -> Iter<'_, V> ⓘ
Returns an iterator visiting all key-value pairs in insertion order.
Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Sourcepub fn iter_mut(&mut self) -> IterMut<'_, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, V> ⓘ
Returns an iterator visiting all key-value pairs mutably in insertion order.
Sourcepub fn entry<K: 'static>(&mut self) -> Entry<'_, V>
pub fn entry<K: 'static>(&mut self) -> Entry<'_, V>
Gets the given type key’s corresponding entry in the map for in-place manipulation.
§Examples
use singletons::SingletonMap;
let mut map = SingletonMap::new();
map.entry::<u8>().or_insert("default".to_string());
assert_eq!(map.get::<u8>(), Some(&"default".to_string()));Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Source§impl<V: Default> SingletonMap<V>
impl<V: Default> SingletonMap<V>
Sourcepub fn get_or_insert_default<K: 'static>(&mut self) -> &mut V
pub fn get_or_insert_default<K: 'static>(&mut self) -> &mut V
Returns a mutable reference to the value for type key K, inserting
a default value if the key is not present.
§Examples
use singletons::SingletonMap;
let mut map: SingletonMap<String> = SingletonMap::new();
let value = map.get_or_insert_default::<u8>();
assert_eq!(value, &String::new());Examples found in repository?
3fn main() {
4 // Create a map that stores String descriptions for different types
5 let mut type_descriptions: SingletonMap<String> = SingletonMap::new();
6
7 // Insert descriptions for various types
8 type_descriptions.insert::<u8>("An unsigned 8-bit integer (0 to 255)".to_string());
9 type_descriptions.insert::<i8>("A signed 8-bit integer (-128 to 127)".to_string());
10 type_descriptions.insert::<u16>("An unsigned 16-bit integer".to_string());
11 type_descriptions.insert::<String>("A heap-allocated string".to_string());
12 type_descriptions.insert::<Vec<u32>>("A vector of 32-bit integers".to_string());
13
14 // Retrieve descriptions
15 println!("u8: {}", type_descriptions.get::<u8>().unwrap());
16 println!("i8: {}", type_descriptions.get::<i8>().unwrap());
17 println!("String: {}", type_descriptions.get::<String>().unwrap());
18
19 // Modify a description
20 if let Some(desc) = type_descriptions.get_mut::<u16>() {
21 desc.push_str(" (0 to 65,535)");
22 }
23 println!("u16: {}", type_descriptions.get::<u16>().unwrap());
24
25 // Use entry API
26 type_descriptions
27 .entry::<f64>()
28 .or_insert("A 64-bit floating-point number".to_string());
29
30 // Update existing entry
31 type_descriptions
32 .entry::<u8>()
33 .and_modify(|desc| desc.push_str(" - commonly used for bytes"))
34 .or_insert("Should not be inserted".to_string());
35
36 println!("\nAll type descriptions:");
37 for (type_key, description) in type_descriptions.iter() {
38 println!(" {}: {}", type_key.as_name(), description);
39 }
40
41 println!("\nTotal types documented: {}", type_descriptions.len());
42
43 // Example with default values
44 let mut counters: SingletonMap<i32> = SingletonMap::new();
45 *counters.get_or_insert_default::<u8>() += 5;
46 *counters.get_or_insert_default::<i8>() -= 3;
47
48 println!("\nCounters:");
49 println!(" u8 counter: {}", counters.get::<u8>().unwrap());
50 println!(" i8 counter: {}", counters.get::<i8>().unwrap());
51}Trait Implementations§
Source§impl<V: Clone> Clone for SingletonMap<V>
impl<V: Clone> Clone for SingletonMap<V>
Source§impl<V: Debug> Debug for SingletonMap<V>
impl<V: Debug> Debug for SingletonMap<V>
Auto Trait Implementations§
impl<V> Freeze for SingletonMap<V>
impl<V> RefUnwindSafe for SingletonMap<V>where
V: RefUnwindSafe,
impl<V> Send for SingletonMap<V>where
V: Send,
impl<V> Sync for SingletonMap<V>where
V: Sync,
impl<V> Unpin for SingletonMap<V>where
V: Unpin,
impl<V> UnwindSafe for SingletonMap<V>where
V: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)