pub struct AtomCollection<T: ModelInfo> { /* private fields */ }
Expand description

Struct of Atom as data-driven design.

Implementations§

Update the element_symbol at the given index.

Errors

This function will return an error if the index is out of bounds.

Examples found in repository?
src/atom/mod.rs (line 144)
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
        let Atom {
            element_symbol,
            atomic_number: element_id,
            xyz,
            fractional_xyz,
            atom_id,
            format_type: _,
        } = new_atom;
        self.update_symbol_at(index, &element_symbol)?;
        self.update_elm_id_at(index, element_id)?;
        self.update_xyz_at(index, xyz)?;
        self.update_frac_xyz_at(index, fractional_xyz)?;
        self.update_atom_id_at(index, atom_id)?;
        Ok(())
    }

Update the element_id at the given index.

Errors

This function will return an error if the index is out of bounds.

Examples found in repository?
src/atom/mod.rs (line 145)
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
        let Atom {
            element_symbol,
            atomic_number: element_id,
            xyz,
            fractional_xyz,
            atom_id,
            format_type: _,
        } = new_atom;
        self.update_symbol_at(index, &element_symbol)?;
        self.update_elm_id_at(index, element_id)?;
        self.update_xyz_at(index, xyz)?;
        self.update_frac_xyz_at(index, fractional_xyz)?;
        self.update_atom_id_at(index, atom_id)?;
        Ok(())
    }

Update the xyz at the given index.

Errors

This function will return an error if the index is out of bounds.

Examples found in repository?
src/atom/mod.rs (line 146)
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
        let Atom {
            element_symbol,
            atomic_number: element_id,
            xyz,
            fractional_xyz,
            atom_id,
            format_type: _,
        } = new_atom;
        self.update_symbol_at(index, &element_symbol)?;
        self.update_elm_id_at(index, element_id)?;
        self.update_xyz_at(index, xyz)?;
        self.update_frac_xyz_at(index, fractional_xyz)?;
        self.update_atom_id_at(index, atom_id)?;
        Ok(())
    }

Update the fractional_xyz at the given index.

Errors

This function will return an error if the index is out of bounds.

Examples found in repository?
src/atom/mod.rs (line 147)
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
        let Atom {
            element_symbol,
            atomic_number: element_id,
            xyz,
            fractional_xyz,
            atom_id,
            format_type: _,
        } = new_atom;
        self.update_symbol_at(index, &element_symbol)?;
        self.update_elm_id_at(index, element_id)?;
        self.update_xyz_at(index, xyz)?;
        self.update_frac_xyz_at(index, fractional_xyz)?;
        self.update_atom_id_at(index, atom_id)?;
        Ok(())
    }

Update the atom_id at the given index.

Errors

This function will return an error if the index is out of bounds.

Examples found in repository?
src/atom/mod.rs (line 148)
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    pub fn update_atom_at(&mut self, index: usize, new_atom: Atom<T>) -> Result<(), InvalidIndex> {
        let Atom {
            element_symbol,
            atomic_number: element_id,
            xyz,
            fractional_xyz,
            atom_id,
            format_type: _,
        } = new_atom;
        self.update_symbol_at(index, &element_symbol)?;
        self.update_elm_id_at(index, element_id)?;
        self.update_xyz_at(index, xyz)?;
        self.update_frac_xyz_at(index, fractional_xyz)?;
        self.update_atom_id_at(index, atom_id)?;
        Ok(())
    }

Update the whole atom at the given index.

Errors

This function will return an error if the index is out of bounds.

Examples found in repository?
src/lattice/mod.rs (line 47)
46
47
48
    pub fn view_atom_by_id(&self, atom_id: u32) -> Result<AtomView<T>, InvalidIndex> {
        self.atoms().view_atom_at((atom_id - 1) as usize)
    }
More examples
Hide additional examples
src/atom/mod.rs (line 231)
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
    fn from(src: &'a AtomCollection<T>) -> Self {
        (0..src.size)
            .into_iter()
            .map(|i| src.view_atom_at(i).unwrap())
            .collect()
    }
}

impl<T: ModelInfo> From<AtomCollection<T>> for Vec<Atom<T>> {
    fn from(src: AtomCollection<T>) -> Self {
        (0..src.size)
            .into_iter()
            .map(|i| -> Atom<T> {
                let view = src.view_atom_at(i).unwrap();
                view.into()
            })
            .collect()
    }
src/model_type/msi.rs (line 188)
184
185
186
187
188
189
190
191
192
193
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let msi_atom_strings: Vec<String> = (0..self.size())
            .into_iter()
            .map(|i| {
                let atom_view = self.view_atom_at(i).unwrap();
                format!("{}", atom_view)
            })
            .collect();
        write!(f, "{}", msi_atom_strings.concat())
    }
Examples found in repository?
src/model_type/cell.rs (line 306)
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
    pub fn spin_total(&self) -> u8 {
        self.atoms()
            .element_symbols()
            .iter()
            .map(|symbol| -> u8 { ELEMENT_TABLE.get_by_symbol(symbol).unwrap().spin })
            .reduce(|total, next| total + next)
            .unwrap()
    }
    /// Build `KptAux` struct
    pub fn build_kptaux(&self) -> KptAux {
        KptAux::new(
            self.settings().kpoints_list().to_vec(),
            self.settings().kpoints_grid(),
            self.settings().kpoints_mp_spacing(),
            self.settings().kpoints_mp_offset(),
        )
    }
    /// Build `TrjAux` struct
    pub fn build_trjaux(&self) -> TrjAux {
        let atom_ids: Vec<u32> = self.atoms().atom_ids().to_vec();
        TrjAux::new(atom_ids)
    }
}

impl Display for AtomCollection<CellModel> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let all_positions_str: Vec<String> = self
            .element_symbols()
            .iter()
            .zip(self.fractional_xyz().iter())
            .map(|(symbol, frac_xyz)| -> String {
                let spin = ELEMENT_TABLE.get_by_symbol(symbol).unwrap().spin();
                let spin_str = if spin > 0 {
                    format!(" SPIN={:14.10}", spin)
                } else {
                    "".into()
                };
                let frac_xyz = frac_xyz.unwrap();
                format!(
                    "{:>3}{:20.16}{:20.16}{:20.16}{spin_str}",
                    symbol, frac_xyz.x, frac_xyz.y, frac_xyz.z
                )
            })
            .collect();
        let joined_positions_str = all_positions_str.join("\n");
        write!(f, "{}", joined_positions_str)
    }
More examples
Hide additional examples
src/model_type/msi.rs (line 85)
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn from(src: T) -> Self {
        let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
        builder
            .with_element_symbols(src.as_ref().element_symbols())
            .unwrap()
            .with_atomic_nums(src.as_ref().atomic_nums())
            .unwrap()
            .with_xyz_coords(src.as_ref().xyz_coords())
            .unwrap()
            .with_fractional_xyz(src.as_ref().fractional_xyz())
            .unwrap()
            .with_atom_ids(src.as_ref().atom_ids())
            .unwrap()
            .finish()
            .unwrap()
            .build()
    }
src/lattice/mod.rs (line 67)
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    pub fn list_element(&self) -> Vec<String> {
        let mut elm_list: Vec<(String, u8)> = vec![];
        elm_list.extend(
            self.atoms()
                .element_symbols()
                .iter()
                .zip(self.atoms.atomic_nums().iter())
                .map(|(sym, id)| (sym.to_string(), *id))
                .collect::<Vec<(String, u8)>>()
                .drain(..)
                .collect::<HashSet<(String, u8)>>()
                .into_iter(),
        );
        elm_list.sort_unstable_by(|a, b| {
            let (_, id_a) = a;
            let (_, id_b) = b;
            id_a.cmp(id_b)
        });
        elm_list
            .iter()
            .map(|(name, _)| name.to_string())
            .collect::<Vec<String>>()
    }
Examples found in repository?
src/model_type/msi.rs (line 87)
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn from(src: T) -> Self {
        let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
        builder
            .with_element_symbols(src.as_ref().element_symbols())
            .unwrap()
            .with_atomic_nums(src.as_ref().atomic_nums())
            .unwrap()
            .with_xyz_coords(src.as_ref().xyz_coords())
            .unwrap()
            .with_fractional_xyz(src.as_ref().fractional_xyz())
            .unwrap()
            .with_atom_ids(src.as_ref().atom_ids())
            .unwrap()
            .finish()
            .unwrap()
            .build()
    }
More examples
Hide additional examples
src/lattice/mod.rs (line 69)
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
    pub fn list_element(&self) -> Vec<String> {
        let mut elm_list: Vec<(String, u8)> = vec![];
        elm_list.extend(
            self.atoms()
                .element_symbols()
                .iter()
                .zip(self.atoms.atomic_nums().iter())
                .map(|(sym, id)| (sym.to_string(), *id))
                .collect::<Vec<(String, u8)>>()
                .drain(..)
                .collect::<HashSet<(String, u8)>>()
                .into_iter(),
        );
        elm_list.sort_unstable_by(|a, b| {
            let (_, id_a) = a;
            let (_, id_b) = b;
            id_a.cmp(id_b)
        });
        elm_list
            .iter()
            .map(|(name, _)| name.to_string())
            .collect::<Vec<String>>()
    }
Examples found in repository?
src/atom/visitor.rs (line 11)
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pub fn get_xyz_by_id<T: ModelInfo>(
    atom_collection: &AtomCollection<T>,
    atom_id: u32,
) -> Option<&Point3<f64>> {
    atom_collection.xyz_coords().get((atom_id - 1) as usize)
}

pub fn get_multiple_xyz_by_id<'a, 'b, T: ModelInfo>(
    atom_collection: &'a AtomCollection<T>,
    atom_ids: &'b [u32],
) -> Vec<Option<&'a Point3<f64>>> {
    atom_ids
        .iter()
        .map(|&id| atom_collection.xyz_coords().get((id - 1) as usize))
        .collect()
}
More examples
Hide additional examples
src/model_type/msi.rs (line 89)
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn from(src: T) -> Self {
        let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
        builder
            .with_element_symbols(src.as_ref().element_symbols())
            .unwrap()
            .with_atomic_nums(src.as_ref().atomic_nums())
            .unwrap()
            .with_xyz_coords(src.as_ref().xyz_coords())
            .unwrap()
            .with_fractional_xyz(src.as_ref().fractional_xyz())
            .unwrap()
            .with_atom_ids(src.as_ref().atom_ids())
            .unwrap()
            .finish()
            .unwrap()
            .build()
    }
src/model_type/cell.rs (line 71)
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    fn from(mut msi_model: T) -> Self {
        let x_axis: Vector3<f64> = Vector::x();
        let a_vec = msi_model
            .as_ref()
            .lattice_vectors()
            .unwrap()
            .vectors()
            .column(0);
        let a_to_x_angle = a_vec.angle(&x_axis);
        if a_to_x_angle != 0.0 {
            let rot_axis = a_vec.cross(&x_axis).normalize();
            let rot_quatd: UnitQuaternion<f64> = UnitQuaternion::new(rot_axis * a_to_x_angle);
            msi_model.as_mut().rotate(&rot_quatd);
        }
        let new_lat_vec = LatticeVectors::new(
            msi_model
                .as_ref()
                .lattice_vectors()
                .unwrap()
                .vectors()
                .to_owned(),
        );
        let fractional_coord_matrix = msi_model
            .as_ref()
            .lattice_vectors()
            .unwrap()
            .fractional_coord_matrix();
        let mut cell_atoms: AtomCollection<CellModel> = msi_model.as_ref().atoms().clone().into();
        let frac_coords: Vec<Point3<f64>> = cell_atoms
            .xyz_coords()
            .iter()
            .map(|xyz| fractional_coord_matrix * xyz)
            .collect();
        cell_atoms
            .fractional_xyz_mut()
            .iter_mut()
            .enumerate()
            .for_each(|(i, f_xyz)| {
                *f_xyz = Some(*frac_coords.get(i).unwrap());
            });
        Self::new(Some(new_lat_vec), cell_atoms, Settings::default())
    }
Examples found in repository?
src/model_type/msi.rs (line 91)
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn from(src: T) -> Self {
        let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
        builder
            .with_element_symbols(src.as_ref().element_symbols())
            .unwrap()
            .with_atomic_nums(src.as_ref().atomic_nums())
            .unwrap()
            .with_xyz_coords(src.as_ref().xyz_coords())
            .unwrap()
            .with_fractional_xyz(src.as_ref().fractional_xyz())
            .unwrap()
            .with_atom_ids(src.as_ref().atom_ids())
            .unwrap()
            .finish()
            .unwrap()
            .build()
    }
More examples
Hide additional examples
src/model_type/cell.rs (line 333)
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let all_positions_str: Vec<String> = self
            .element_symbols()
            .iter()
            .zip(self.fractional_xyz().iter())
            .map(|(symbol, frac_xyz)| -> String {
                let spin = ELEMENT_TABLE.get_by_symbol(symbol).unwrap().spin();
                let spin_str = if spin > 0 {
                    format!(" SPIN={:14.10}", spin)
                } else {
                    "".into()
                };
                let frac_xyz = frac_xyz.unwrap();
                format!(
                    "{:>3}{:20.16}{:20.16}{:20.16}{spin_str}",
                    symbol, frac_xyz.x, frac_xyz.y, frac_xyz.z
                )
            })
            .collect();
        let joined_positions_str = all_positions_str.join("\n");
        write!(f, "{}", joined_positions_str)
    }
Examples found in repository?
src/model_type/cell.rs (line 76)
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    fn from(mut msi_model: T) -> Self {
        let x_axis: Vector3<f64> = Vector::x();
        let a_vec = msi_model
            .as_ref()
            .lattice_vectors()
            .unwrap()
            .vectors()
            .column(0);
        let a_to_x_angle = a_vec.angle(&x_axis);
        if a_to_x_angle != 0.0 {
            let rot_axis = a_vec.cross(&x_axis).normalize();
            let rot_quatd: UnitQuaternion<f64> = UnitQuaternion::new(rot_axis * a_to_x_angle);
            msi_model.as_mut().rotate(&rot_quatd);
        }
        let new_lat_vec = LatticeVectors::new(
            msi_model
                .as_ref()
                .lattice_vectors()
                .unwrap()
                .vectors()
                .to_owned(),
        );
        let fractional_coord_matrix = msi_model
            .as_ref()
            .lattice_vectors()
            .unwrap()
            .fractional_coord_matrix();
        let mut cell_atoms: AtomCollection<CellModel> = msi_model.as_ref().atoms().clone().into();
        let frac_coords: Vec<Point3<f64>> = cell_atoms
            .xyz_coords()
            .iter()
            .map(|xyz| fractional_coord_matrix * xyz)
            .collect();
        cell_atoms
            .fractional_xyz_mut()
            .iter_mut()
            .enumerate()
            .for_each(|(i, f_xyz)| {
                *f_xyz = Some(*frac_coords.get(i).unwrap());
            });
        Self::new(Some(new_lat_vec), cell_atoms, Settings::default())
    }
Examples found in repository?
src/model_type/cell.rs (line 323)
322
323
324
325
    pub fn build_trjaux(&self) -> TrjAux {
        let atom_ids: Vec<u32> = self.atoms().atom_ids().to_vec();
        TrjAux::new(atom_ids)
    }
More examples
Hide additional examples
src/model_type/msi.rs (line 93)
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    fn from(src: T) -> Self {
        let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
        builder
            .with_element_symbols(src.as_ref().element_symbols())
            .unwrap()
            .with_atomic_nums(src.as_ref().atomic_nums())
            .unwrap()
            .with_xyz_coords(src.as_ref().xyz_coords())
            .unwrap()
            .with_fractional_xyz(src.as_ref().fractional_xyz())
            .unwrap()
            .with_atom_ids(src.as_ref().atom_ids())
            .unwrap()
            .finish()
            .unwrap()
            .build()
    }
Examples found in repository?
src/model_type/msi.rs (line 83)
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
    fn from(src: T) -> Self {
        let builder = AtomCollectionBuilder::<MsiModel, No>::new(src.as_ref().size());
        builder
            .with_element_symbols(src.as_ref().element_symbols())
            .unwrap()
            .with_atomic_nums(src.as_ref().atomic_nums())
            .unwrap()
            .with_xyz_coords(src.as_ref().xyz_coords())
            .unwrap()
            .with_fractional_xyz(src.as_ref().fractional_xyz())
            .unwrap()
            .with_atom_ids(src.as_ref().atom_ids())
            .unwrap()
            .finish()
            .unwrap()
            .build()
    }
}

impl<T> From<T> for LatticeModel<MsiModel>
where
    T: AsRef<LatticeModel<CellModel>>,
{
    fn from(cell_model: T) -> Self {
        let new_lat_vec = LatticeVectors::new(
            cell_model
                .as_ref()
                .lattice_vectors()
                .unwrap()
                .vectors()
                .to_owned(),
        );
        // Convert the SoA to AoS for easier sorting.
        let msi_atoms: AtomCollection<MsiModel> = cell_model.as_ref().atoms().into();
        let mut msi_atom_array: Vec<Atom<MsiModel>> = msi_atoms.into();
        msi_atom_array.sort_by_key(|a| a.atom_id());
        // Convert AoS back to SoA.
        let msi_atom_collection: AtomCollection<MsiModel> = msi_atom_array.into();
        let mut msi_model = Self::new(Some(new_lat_vec), msi_atom_collection, Settings::default());
        let y_axis: Vector3<f64> = Vector::y();
        let b_vec = cell_model
            .as_ref()
            .lattice_vectors()
            .unwrap()
            .vectors()
            .column(1);
        let b_to_y_angle = b_vec.angle(&y_axis);
        if b_to_y_angle != 0.0 {
            let rot_axis = b_vec.cross(&y_axis).normalize();
            let rot_quatd: UnitQuaternion<f64> = UnitQuaternion::new(rot_axis * b_to_y_angle);
            msi_model.rotate(&rot_quatd);
        }
        msi_model
    }
}

impl LatticeModel<MsiModel> {
    pub fn msi_export(&self) -> String {
        if let Some(lattice_vectors) = self.lattice_vectors() {
            let headers_vectors: Vec<String> = vec![
                "# MSI CERIUS2 DataModel File Version 4 0\n".to_string(),
                "(1 Model\n".to_string(),
                "  (A I CRY/DISPLAY (192 256))\n".to_string(),
                format!("  (A I PeriodicType {})\n", self.settings().periodic_type()),
                format!("  (A C SpaceGroup \"{}\")\n", self.settings().space_group()),
                format!("{}", lattice_vectors),
                format!(
                    "  (A D CRY/TOLERANCE {})\n",
                    self.settings().cry_tolerance()
                ),
            ];
            format!("{}{})", headers_vectors.concat(), self.atoms())
        } else {
            let headers = "# MSI CERIUS2 DataModel File Version 4 0\n(1 Model\n";
            format!("{}{})", headers, self.atoms())
        }
    }
}

impl<'a> Display for AtomView<'a, MsiModel> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            r#"  ({item_id} Atom
    (A C ACL "{elm_id} {elm}")
    (A C Label "{elm}")
    (A D XYZ ({x:.12} {y:.12} {z:.12}))
    (A I Id {atom_id})
  )
"#,
            item_id = self.atom_id() + 1,
            elm_id = self.atomic_number(),
            elm = self.element_symbol(),
            x = self.xyz().x,
            y = self.xyz().y,
            z = self.xyz().z,
            atom_id = self.atom_id(),
        )
    }
}

impl Display for AtomCollection<MsiModel> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let msi_atom_strings: Vec<String> = (0..self.size())
            .into_iter()
            .map(|i| {
                let atom_view = self.view_atom_at(i).unwrap();
                format!("{}", atom_view)
            })
            .collect();
        write!(f, "{}", msi_atom_strings.concat())
    }

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.