pub struct Molecule {
pub properties: PropertyStore,
pub lattice: Option<Lattice>,
/* private fields */
}
Expand description
Molecule is the most important data structure in gchemol, which repsents “any singular entity, irrespective of its nature, used to concisely express any type of chemical particle that can exemplify some process: for example, atoms, molecules, ions, etc. can all undergo a chemical reaction”. Molecule may have chemical bonds between atoms.
Reference
- http://goldbook.iupac.org/M03986.html
- https://en.wikipedia.org/wiki/Molecular_entity
Fields§
§properties: PropertyStore
Arbitrary property stored in key-value pair. Key is a string type, but it is the responsibility of the user to correctly interpret the value.
lattice: Option<Lattice>
Crystalline lattice for structure using periodic boundary conditions
Implementations§
source§impl Molecule
impl Molecule
sourcepub fn from_database(name: &str) -> Molecule
pub fn from_database(name: &str) -> Molecule
Returns Molecule
created from the internal database (mainly for tests).
Available names: CH4
, H2O
, HCN
source§impl Molecule
impl Molecule
Chemical formula
sourcepub fn formula(&self) -> String
pub fn formula(&self) -> String
Return the molecule formula represented in string Return empty string if molecule containing no atom
sourcepub fn reduced_symbols(&self) -> HashMap<String, usize, RandomState>
pub fn reduced_symbols(&self) -> HashMap<String, usize, RandomState>
Return a hashmap for counting atom symbols.
source§impl Molecule
impl Molecule
Lattice related methods
sourcepub fn get_lattice(&self) -> Option<&Lattice>
pub fn get_lattice(&self) -> Option<&Lattice>
Get a reference to Lattice
struct.
sourcepub fn set_lattice(&mut self, lat: Lattice)
pub fn set_lattice(&mut self, lat: Lattice)
Set periodic lattice
sourcepub fn is_periodic(&self) -> bool
pub fn is_periodic(&self) -> bool
Return true if Molecule
is a periodic structure.
sourcepub fn unbuild_crystal(&mut self) -> Option<Lattice>
pub fn unbuild_crystal(&mut self) -> Option<Lattice>
Unbuild current crystal structure leaving a nonperiodic
structure. Return Lattice
object if periodic, otherwise return None.
sourcepub fn scaled_positions(&self) -> Option<impl Iterator<Item = [f64; 3]>>
👎Deprecated: use get_scaled_positions instead
pub fn scaled_positions(&self) -> Option<impl Iterator<Item = [f64; 3]>>
Return fractional coordinates relative to unit cell. Return None if not a periodic structure
sourcepub fn get_scaled_positions(&self) -> Option<impl Iterator<Item = [f64; 3]>>
pub fn get_scaled_positions(&self) -> Option<impl Iterator<Item = [f64; 3]>>
Return fractional coordinates relative to unit cell. Return None if not a periodic structure
sourcepub fn set_scaled_positions<T, P>(&mut self, scaled: T)where
T: IntoIterator<Item = P>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_scaled_positions<T, P>(&mut self, scaled: T)where
T: IntoIterator<Item = P>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Set fractional coordinates of atoms in sequence order.
Panics if Molecule is aperiodic.
sourcepub fn set_scaled_positions_from<T, P>(&mut self, scaled: T)where
T: IntoIterator<Item = (usize, P)>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_scaled_positions_from<T, P>(&mut self, scaled: T)where
T: IntoIterator<Item = (usize, P)>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Set fractional coordinates of atoms specified in serial numbers.
Panics if Molecule is aperiodic.
source§impl Molecule
impl Molecule
sourcepub fn set_lattice_from_bounding_box(&mut self, padding: f64)
pub fn set_lattice_from_bounding_box(&mut self, padding: f64)
Create a Lattice
from the minimal bounding box of the Molecule
extended by a positive value of padding
. NOTE: padding has to be large
enough (> 0.5) to avoid self interaction with its periodic mirror.
sourcepub fn bounding_box(&self, padding: f64) -> [f64; 3]
pub fn bounding_box(&self, padding: f64) -> [f64; 3]
Return minimal bounding box in x, y, z directions
impl Molecule
Methods for internal uses
source§impl Molecule
impl Molecule
Molecule
constructors
sourcepub fn from_atoms<T>(atoms: T) -> Moleculewhere
T: IntoIterator,
<T as IntoIterator>::Item: Into<Atom>,
pub fn from_atoms<T>(atoms: T) -> Moleculewhere
T: IntoIterator,
<T as IntoIterator>::Item: Into<Atom>,
Build a molecule from iterator of atoms associated with serial numbers from 1.
sourcepub fn from_graph(graph: NxGraph<Atom, Bond>) -> Molecule
pub fn from_graph(graph: NxGraph<Atom, Bond>) -> Molecule
Build Molecule
from raw graph struct.
sourcepub fn from_graph_raw(
graph: NxGraph<Atom, Bond>,
atoms: impl IntoIterator<Item = usize>
) -> Molecule
pub fn from_graph_raw(
graph: NxGraph<Atom, Bond>,
atoms: impl IntoIterator<Item = usize>
) -> Molecule
Build Molecule
from raw graph struct, with atom serial numbers.
source§impl Molecule
impl Molecule
Core methods
sourcepub fn add_atom(&mut self, a: usize, atom: Atom)
pub fn add_atom(&mut self, a: usize, atom: Atom)
Add atom a
into molecule. If Atom numbered as a
already exists in
molecule, then the associated Atom will be updated with atom
.
sourcepub fn remove_atom(&mut self, a: usize) -> Option<Atom>
pub fn remove_atom(&mut self, a: usize) -> Option<Atom>
Remove Atom a
from Molecule
.
Return the removed Atom on success, and return None if Atom a
does not
exist.
sourcepub fn add_bond(&mut self, a: usize, b: usize, bond: Bond)
pub fn add_bond(&mut self, a: usize, b: usize, bond: Bond)
Add bond
between Atom a
and Atom b
into molecule. The existing
Bond will be replaced if Atom a
already bonded with Atom b
.
Panic if the specified atom a
or b
does not exist
sourcepub fn remove_bond(&mut self, a: usize, b: usize) -> Option<Bond>
pub fn remove_bond(&mut self, a: usize, b: usize) -> Option<Bond>
Remove the bond between atom a
and atom b
.
Returns the removed Bond
on success
Panic if the specified atom a
or b
does not exist
sourcepub fn atoms(&self) -> impl Iterator<Item = (usize, &Atom)>
pub fn atoms(&self) -> impl Iterator<Item = (usize, &Atom)>
Iterate over atoms ordered by serial numbers.
sourcepub fn bonds(&self) -> impl Iterator<Item = (usize, usize, &Bond)>
pub fn bonds(&self) -> impl Iterator<Item = (usize, usize, &Bond)>
Iterate over bonds in arbitrary order.
sourcepub fn serial_numbers(&self) -> impl Iterator<Item = usize>
pub fn serial_numbers(&self) -> impl Iterator<Item = usize>
Iterate over atom serial numbers in ascending order. Serial number is an
unsigned integer (1-based, traditionally) for accessing Atom
in
Molecule
sourcepub fn numbers(&self) -> impl Iterator<Item = usize>
pub fn numbers(&self) -> impl Iterator<Item = usize>
A shorter alias to serial_numbers method.
sourcepub fn symbols(&self) -> impl Iterator<Item = &str>
pub fn symbols(&self) -> impl Iterator<Item = &str>
Iterate over atom symbols ordered by serial numbers.
sourcepub fn masses(&self) -> impl Iterator<Item = f64>
pub fn masses(&self) -> impl Iterator<Item = f64>
Iterate over atom’s mass ordered by atom’s serial numbers. Dummy atom has mass of zero.
sourcepub fn atomic_numbers(&self) -> impl Iterator<Item = usize>
pub fn atomic_numbers(&self) -> impl Iterator<Item = usize>
Iterate over atomic numbers.
sourcepub fn positions(&self) -> impl Iterator<Item = [f64; 3]>
pub fn positions(&self) -> impl Iterator<Item = [f64; 3]>
Iterate over atom positions ordered by serial numbers.
sourcepub fn title(&self) -> String
pub fn title(&self) -> String
Return the name of the molecule, which is typpically modified for safely storing in various chemical file formats.
source§impl Molecule
impl Molecule
Edit Molecule
sourcepub fn get_atom_unchecked(&self, sn: usize) -> &Atom
pub fn get_atom_unchecked(&self, sn: usize) -> &Atom
Read access to atom by atom serial number. Panic if no this atom.
sourcepub fn has_atom(&self, sn: usize) -> bool
pub fn has_atom(&self, sn: usize) -> bool
Returns true if the molecule contains atom with the given sn
sourcepub fn get_atom_mut(&mut self, sn: usize) -> Option<&mut Atom>
pub fn get_atom_mut(&mut self, sn: usize) -> Option<&mut Atom>
Mutable access to atom by atom serial number.
sourcepub fn get_atom_unchecked_mut(&mut self, sn: usize) -> &mut Atom
pub fn get_atom_unchecked_mut(&mut self, sn: usize) -> &mut Atom
Mutable access to atom by atom serial number. Panic if no this atom.
sourcepub fn get_bond(&self, sn1: usize, sn2: usize) -> Option<&Bond>
pub fn get_bond(&self, sn1: usize, sn2: usize) -> Option<&Bond>
Read access to bond by a pair of atoms. Return None if there is no bond
between Atom sn1
and Atom sn2
.
sourcepub fn has_bond(&self, sn1: usize, sn2: usize) -> bool
pub fn has_bond(&self, sn1: usize, sn2: usize) -> bool
Returns true if the molcule contains bond between atom sn1
and sn2
sourcepub fn get_bond_mut(&mut self, sn1: usize, sn2: usize) -> Option<&mut Bond>
pub fn get_bond_mut(&mut self, sn1: usize, sn2: usize) -> Option<&mut Bond>
Mutable access to bond by a pair of atoms.
sourcepub fn set_position<P>(&mut self, sn: usize, position: P)where
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_position<P>(&mut self, sn: usize, position: P)where
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Set atom position.
Panic if atom sn
does not exist.
sourcepub fn set_symbol<S>(&mut self, sn: usize, sym: S)where
S: Into<AtomKind>,
pub fn set_symbol<S>(&mut self, sn: usize, sym: S)where
S: Into<AtomKind>,
Set atom symbol.
Panic if atom sn
does not exist.
sourcepub fn add_atoms_from<T, P>(&mut self, atoms: T)where
T: IntoIterator<Item = (usize, P)>,
P: Into<Atom>,
pub fn add_atoms_from<T, P>(&mut self, atoms: T)where
T: IntoIterator<Item = (usize, P)>,
P: Into<Atom>,
Add a list of atoms into molecule.
sourcepub fn add_bonds_from<T>(&mut self, bonds: T)where
T: IntoIterator<Item = (usize, usize, Bond)>,
pub fn add_bonds_from<T>(&mut self, bonds: T)where
T: IntoIterator<Item = (usize, usize, Bond)>,
Add a list of bonds into molecule.
sourcepub fn set_positions<T, P>(&mut self, positions: T)where
T: IntoIterator<Item = P>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_positions<T, P>(&mut self, positions: T)where
T: IntoIterator<Item = P>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Set positions of atoms in sequential order.
sourcepub fn update_positions<T, P>(&mut self, positions: T)where
T: IntoIterator<Item = P>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn update_positions<T, P>(&mut self, positions: T)where
T: IntoIterator<Item = P>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Update positions of atoms in sequential order, with freezing coordinates ignored.
sourcepub fn set_positions_from<T, P>(&mut self, selected_positions: T)where
T: IntoIterator<Item = (usize, P)>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_positions_from<T, P>(&mut self, selected_positions: T)where
T: IntoIterator<Item = (usize, P)>,
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Set positions of specified atoms
sourcepub fn set_symbols<T, S>(&mut self, symbols: T)where
T: IntoIterator<Item = S>,
S: Into<AtomKind>,
pub fn set_symbols<T, S>(&mut self, symbols: T)where
T: IntoIterator<Item = S>,
S: Into<AtomKind>,
Set element symbols
sourcepub fn remove_atoms_from(&mut self)
pub fn remove_atoms_from(&mut self)
Remove atoms from .. (unimplemented)
sourcepub fn remove_bonds_from(&mut self)
pub fn remove_bonds_from(&mut self)
Remove bonds from .. (unimplemented)
source§impl Molecule
impl Molecule
Extra properties for Molecule
.
sourcepub fn set_velocity<P>(&mut self, sn: usize, m: P)where
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_velocity<P>(&mut self, sn: usize, m: P)where
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
sourcepub fn set_velocities<T, M>(&mut self, velocities: T)where
T: IntoIterator<Item = M>,
M: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn set_velocities<T, M>(&mut self, velocities: T)where
T: IntoIterator<Item = M>,
M: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Set velocities of atoms in sequential order.
sourcepub fn velocities(&self) -> impl Iterator<Item = [f64; 3]>
pub fn velocities(&self) -> impl Iterator<Item = [f64; 3]>
Return an iterator over atom velocities.
source§impl Molecule
impl Molecule
Handling chemical bonds in Molecule
.
sourcepub fn unbond(&mut self, atom_indices1: &[usize], atom_indices2: &[usize])
pub fn unbond(&mut self, atom_indices1: &[usize], atom_indices2: &[usize])
Removes all bonds between two selections to respect pymol’s unbond command.
Parameters
atom_indices1: the first collection of atoms
atom_indices2: the other collection of atoms
Reference
https://pymolwiki.org/index.php/Unbond
source§impl Molecule
impl Molecule
sourcepub fn freezing_atoms_mask(&self) -> Mask
pub fn freezing_atoms_mask(&self) -> Mask
Create a Mask
for freezing atoms in 1-D vec.
sourcepub fn freezing_coords_mask(&self) -> Mask
pub fn freezing_coords_mask(&self) -> Mask
Create a Mask
for Cartesian coordinates (3D) of freezing atoms in flatten 1-D vec.
source§impl Molecule
impl Molecule
Geometry related methods
sourcepub fn translate<P>(&mut self, disp: P)where
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
pub fn translate<P>(&mut self, disp: P)where
P: Into<Matrix<f64, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<f64, 3, 1>>>,
Translate the whole molecule by a displacement
sourcepub fn center_of_geometry(&self) -> [f64; 3]
pub fn center_of_geometry(&self) -> [f64; 3]
Return the center of geometry of molecule (COG).
source§impl Molecule
impl Molecule
sourcepub fn distance(&self, i: usize, j: usize) -> f64
👎Deprecated: get_distance instead
pub fn distance(&self, i: usize, j: usize) -> f64
Return the distance between atom i
and atom j
. For periodic
structure, this method will return the distance under the minimum image
convention.
Panic
- if atom indices
i
orj
out of range.
sourcepub fn get_distance(&self, i: usize, j: usize) -> Option<f64>
pub fn get_distance(&self, i: usize, j: usize) -> Option<f64>
Return the distance of two atoms i
, j
. For periodic
structure, this method will return the distance under the
minimum image convention. Return None if any serial number is
invalid.
source§impl Molecule
impl Molecule
sourcepub fn superimpose_onto(
&mut self,
mol_ref: &Molecule,
selection: Option<&[usize]>
) -> f64
pub fn superimpose_onto(
&mut self,
mol_ref: &Molecule,
selection: Option<&[usize]>
) -> f64
Superimpose structure onto mol_ref
which will be held fixed
during alignment. Return superposition rmsd on done.
NOTE
- The atoms must be in one-to-one mapping with atoms in
mol_ref
- The structure could be mirrored for better alignment.
- Heavy atoms have more weights.
source§impl Molecule
impl Molecule
Geometry related methods
sourcepub fn inertia_matrix(&self) -> [[f64; 3]; 3]
pub fn inertia_matrix(&self) -> [[f64; 3]; 3]
Return molecule’s inertia matrix (3x3) in reference to molecule’s center of mass
sourcepub fn center_of_mass(&self) -> [f64; 3]
pub fn center_of_mass(&self) -> [f64; 3]
Return the center of mass of molecule (COM).
source§impl Molecule
impl Molecule
Display order of Atom
in Molecule
sourcepub fn renumber_using(&mut self, atoms: &[usize])
pub fn renumber_using(&mut self, atoms: &[usize])
Renumber atoms by user provided numbers for each atom.
NOTE
- number in
atoms
must be unique and in one-to-one mapping to original numbering.
sourcepub fn swap_order(&mut self, sn1: usize, sn2: usize)
pub fn swap_order(&mut self, sn1: usize, sn2: usize)
Swap the display order of two Atoms sn1
and sn2
.
Panic
- Panics if serial numbers
sn1
orsn2
out of bounds.
source§impl Molecule
impl Molecule
sourcepub fn find_rings(&self, nmax: usize) -> Vec<HashSet<usize, RandomState>, Global> ⓘ
pub fn find_rings(&self, nmax: usize) -> Vec<HashSet<usize, RandomState>, Global> ⓘ
source§impl Molecule
impl Molecule
High level topology structure of Molecule
.
sourcepub fn nbonds_between(&self, sn1: usize, sn2: usize) -> Option<usize>
pub fn nbonds_between(&self, sn1: usize, sn2: usize) -> Option<usize>
Return the shortest distance counted in number of chemical bonds between two atoms. Return None if they are not connected.
sourcepub fn path_between(&self, sn1: usize, sn2: usize) -> Option<Vec<usize, Global>>
pub fn path_between(&self, sn1: usize, sn2: usize) -> Option<Vec<usize, Global>>
Return the shortest path between two atoms. Return None if they are not connected.
Panics
- panic if there is no atom associated with
sn1
orsn2
sourcepub fn connected(&self, a: usize) -> impl Iterator<Item = usize>
pub fn connected(&self, a: usize) -> impl Iterator<Item = usize>
Return all directly bonded atoms with a
sourcepub fn get_sub_molecule(&self, atoms: &[usize]) -> Option<Molecule>
pub fn get_sub_molecule(&self, atoms: &[usize]) -> Option<Molecule>
Return a sub molecule induced by atoms
in parent
molecule. Return None if atom serial numbers are
invalid. Return an empty Molecule if atoms
empty.
NOTE
- The sub molecule shares the same numbering system with its parent.
sourcepub fn bond_graph(&self) -> NxGraph<usize, usize>
pub fn bond_graph(&self) -> NxGraph<usize, usize>
Return a shallow connectivity graph without copying atom/bond data
sourcepub fn fragmented(&self) -> impl Iterator<Item = Molecule>
pub fn fragmented(&self) -> impl Iterator<Item = Molecule>
Break molecule into multiple fragments based on its bonding connectivity.
sourcepub fn nfragments(&self) -> usize
pub fn nfragments(&self) -> usize
Return the number of fragments based on bonding connectivity.
source§impl Molecule
impl Molecule
sourcepub fn selection_by_expanding_bond(
&self,
m: usize,
n: usize
) -> Vec<usize, Global> ⓘ
pub fn selection_by_expanding_bond(
&self,
m: usize,
n: usize
) -> Vec<usize, Global> ⓘ
Return selected atoms by expanding n
chemical bonds away from
the center atom m
Note: the center atom m is put last in returned molecule.
sourcepub fn selection_by_distance(&self, n: usize, r: f64) -> Vec<usize, Global> ⓘ
pub fn selection_by_distance(&self, n: usize, r: f64) -> Vec<usize, Global> ⓘ
Return selected atoms by cutoff distance r
nearby central
atom n
NOTE: For periodic structure, the selection returned
could be not unique due to periodic images.
sourcepub fn create_neighbor_probe(&self) -> Neighborhood
pub fn create_neighbor_probe(&self) -> Neighborhood
Return a Neighborhood
struct for probing nearest neighbors in mol
N.B. The neighbor node index is defined using atom serial number
Example
let probe = mol.create_neighbor_probe();
let p = [1.0, 2.0, 3.0];
let r_cut = 3.2;
let neighbors = probe.search(p, r_cut);
let neighbors = probe.neighbors(12, r_cut);
Trait Implementations§
source§impl<'de> Deserialize<'de> for Molecule
impl<'de> Deserialize<'de> for Molecule
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Molecule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Molecule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Serialize for Molecule
impl Serialize for Molecule
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl StringIO for Molecule
impl StringIO for Molecule
source§fn format_as<S>(&self, fmt: S) -> Result<String, Error>where
S: AsRef<str>,
fn format_as<S>(&self, fmt: S) -> Result<String, Error>where
S: AsRef<str>,
Format molecule as string in specific molecular file format. Return
error if cannot format molecule in fmt
.
source§fn parse_from<R, S>(s: R, fmt: S) -> Result<Molecule, Error>where
R: Read + Seek,
S: AsRef<str>,
fn parse_from<R, S>(s: R, fmt: S) -> Result<Molecule, Error>where
R: Read + Seek,
S: AsRef<str>,
construct molecule from string in specific molecular file format.
fn from_str<S>(s: &str, fmt: S) -> Result<Molecule, Error>where
S: AsRef<str>,
source§impl TemplateRendering for Molecule
impl TemplateRendering for Molecule
Auto Trait Implementations§
impl RefUnwindSafe for Molecule
impl Send for Molecule
impl Sync for Molecule
impl Unpin for Molecule
impl UnwindSafe for Molecule
Blanket Implementations§
source§impl<T> Configure for Twhere
T: Default + DeserializeOwned + Serialize,
impl<T> Configure for Twhere
T: Default + DeserializeOwned + Serialize,
source§fn print_toml(&self)
fn print_toml(&self)
source§fn from_json(s: &str) -> Result<Self, Error>
fn from_json(s: &str) -> Result<Self, Error>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.