Struct pdbtbx::PDB

source ·
pub struct PDB {
    pub identifier: Option<String>,
    pub scale: Option<TransformationMatrix>,
    pub origx: Option<TransformationMatrix>,
    pub unit_cell: Option<UnitCell>,
    pub symmetry: Option<Symmetry>,
    /* private fields */
}
Expand description

A PDB struct is generated by opening a PDB or mmCIF file. It contains all information present in this file, like its atoms, bonds, hierarchy , and metadata. The struct can be used to access, interact with, and edit this data.

use pdbtbx::*;
let (mut pdb, _errors) = pdbtbx::open(
        "example-pdbs/1ubq.pdb",
        StrictnessLevel::Medium
    ).unwrap();

pdb.remove_atoms_by(|atom| atom.element() == Some(&Element::H)); // Remove all H atoms

let mut avg_b_factor = 0.0;
for atom in pdb.atoms() { // Iterate over all atoms in the structure
    avg_b_factor += atom.b_factor();
}
avg_b_factor /= pdb.atom_count() as f64;

println!("The average B factor of the protein is: {}", avg_b_factor);
pdbtbx::save(&pdb, "dump/1ubq_no_hydrogens.pdb", pdbtbx::StrictnessLevel::Loose);

Fields§

§identifier: Option<String>

The identifier as posed in the PDB Header or mmCIF entry.id, normally a 4 char string like ‘1UBQ’.

§scale: Option<TransformationMatrix>

The Scale needed to transform orthogonal coordinates to fractional coordinates. This is inversely related to the unit cell.

§origx: Option<TransformationMatrix>

The OrigX needed to transform orthogonal coordinates to submitted coordinates. In normal cases this is equal to the identity transformation.

§unit_cell: Option<UnitCell>

The unit cell of the crystal, containing its size and shape. This is the size and shape of the repeating element in the crystal.

§symmetry: Option<Symmetry>

The Symmetry or space group of the crystal. This is the way in which the protein is placed inside the unit cell.

Implementations§

source§

impl PDB

Creators

Creator functions for a PDB file

source

pub const fn new() -> PDB

Create an empty PDB struct.

source§

impl PDB

Remarks

Functionality for working with remarks.

source

pub fn remark_count(&self) -> usize

Get the number of remark records in the PDB file.

source

pub fn remarks(&self) -> impl DoubleEndedIterator<Item = &(usize, String)> + '_

Get an iterator of references to the remarks, containing the remark-type-number and a line of free text.

source

pub fn par_remarks(&self) -> impl ParallelIterator<Item = &(usize, String)> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to the remarks, containing the remark-type-number and a line of free text.

source

pub fn remarks_mut( &mut self ) -> impl DoubleEndedIterator<Item = &mut (usize, String)> + '_

Get an iterator of references to the remarks, containing the remark-type-number and a line of free text.

source

pub fn par_remarks_mut( &mut self ) -> impl ParallelIterator<Item = &mut (usize, String)> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to the remarks, containing the remark-type-number and a line of free text.

source

pub fn add_remark( &mut self, remark_type: usize, remark_text: String ) -> Result<(), PDBError>

Add a remark

Arguments
  • remark_type - the remark-type-number
  • remark_text - the free line of text, containing the actual remark
Fails

It fails if the text if too long, the text contains invalid characters or the remark-type-number is not valid (wwPDB v3.30).

source

pub fn delete_remarks_by<F>(&mut self, predicate: F)where F: Fn(&(usize, String)) -> bool,

Delete the remarks matching the given predicate.

source§

impl PDB

MtriX

Functionality for working with the MtriX records form the PDB. The MtriX are needed to transform the Models to the full asymmetric subunit, if needed to contain the non-crystallographic symmetry.

source

pub fn mtrix(&self) -> impl DoubleEndedIterator<Item = &MtriX> + '_

Get an iterator of references to the MtriX records for this PDB.

source

pub fn par_mtrix(&self) -> impl ParallelIterator<Item = &MtriX> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to the MtriX records for this PDB.

source

pub fn mtrix_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut MtriX> + '_

Get an iterator of mutable references to the MtriX records for this PDB.

source

pub fn par_mtrix_mut(&mut self) -> impl ParallelIterator<Item = &mut MtriX> + '_

Available on crate feature rayon only.

Get a parallel iterator of mutable references to the MtriX records for this PDB.

source

pub fn add_mtrix(&mut self, mtrix: MtriX)

Add a MtriX to this PDB.

source

pub fn delete_mtrix_by<F>(&mut self, predicate: F)where F: Fn(&MtriX) -> bool,

Delete the MtriX matching the given predicate.

source§

impl<'a> PDB

source

pub fn add_model(&mut self, new_model: Model)

Adds a Model to this PDB.

source

pub fn model_count(&self) -> usize

Get the number of Models making up this PDB.

source

pub fn chain_count(&self) -> usize

Get the number of Chains making up this PDB.

source

pub fn residue_count(&self) -> usize

Get the number of Residues making up this PDB.

source

pub fn par_residue_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Residues making up this PDB in parallel.

source

pub fn conformer_count(&self) -> usize

Get the number of Conformers making up this PDB.

source

pub fn par_conformer_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Conformers making up this PDB in parallel.

source

pub fn atom_count(&self) -> usize

Get the number of Atoms making up this PDB.

source

pub fn par_atom_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Atoms making up this PDB in parallel.

source

pub fn total_chain_count(&self) -> usize

Get the number of Chains making up this PDB. Includes all models.

source

pub fn par_total_chain_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Chains making up this PDB in parallel. Includes all models.

source

pub fn total_residue_count(&self) -> usize

Get the number of Residues making up this PDB. Includes all models.

source

pub fn par_total_residue_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Residues making up this PDB in parallel. Includes all models.

source

pub fn total_conformer_count(&self) -> usize

Get the number of Conformer making up this PDB. Includes all models.

source

pub fn par_total_conformer_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Conformer making up this PDB in parallel. Includes all models.

source

pub fn total_atom_count(&self) -> usize

Get the number of Atoms making up this PDB. Includes all models.

source

pub fn par_total_atom_count(&self) -> usize

Available on crate feature rayon only.

Get the number of Atoms making up this PDB in parallel. Includes all models.

source

pub fn model(&self, index: usize) -> Option<&Model>

Get a reference to a specific Model from the list of Models making up this PDB.

Arguments
  • index - the index of the Model
Fails

It fails and returns None when the index is outside bounds.

source

pub fn model_mut(&mut self, index: usize) -> Option<&mut Model>

Get a mutable reference to a specific Model from the list of Models making up this PDB.

Arguments
  • index - the index of the Model
Fails

It fails and returns None when the index is outside bounds.

source

pub fn chain(&self, index: usize) -> Option<&Chain>

Get a reference to a specific Chain from the list of Chains making up this PDB.

Arguments
  • index - the index of the Chain
Fails

It fails and returns None when the index is outside bounds.

source

pub fn chain_mut(&mut self, index: usize) -> Option<&mut Chain>

Get a mutable reference to a specific Chain from the list of Chains making up this PDB.

Arguments
  • index - the index of the Chain
Fails

It fails and returns None when the index is outside bounds.

source

pub fn residue(&self, index: usize) -> Option<&Residue>

Get a reference to a specific Residue from the Residues making up this PDB.

Arguments
  • index - the index of the Residue
Fails

It fails and returns None when the index is outside bounds.

source

pub fn residue_mut(&mut self, index: usize) -> Option<&mut Residue>

Get a mutable reference to a specific Residue from the Residues making up this PDB.

Arguments
  • index - the index of the Residue
Fails

It fails and returns None when the index is outside bounds.

source

pub fn conformer(&self, index: usize) -> Option<&Conformer>

Get a reference to a specific Conformer from the Conformers making up this PDB.

Arguments
  • index - the index of the Conformer
Fails

It fails and returns None when the index is outside bounds.

source

pub fn conformer_mut(&mut self, index: usize) -> Option<&mut Conformer>

Get a mutable reference to a specific Conformer from the Conformers making up this PDB.

Arguments
  • index - the index of the Conformer
Fails

It fails and returns None when the index is outside bounds.

source

pub fn atom(&self, index: usize) -> Option<&Atom>

Get a reference to a specific Atom from the Atoms making up this PDB.

Arguments
  • index - the index of the Atom
Fails

It fails and returns None when the index is outside bounds.

source

pub fn atom_mut(&mut self, index: usize) -> Option<&mut Atom>

Get a mutable reference to a specific Atom from the Atoms making up this PDB.

Arguments
  • index - the index of the Atom
Fails

It fails and returns None when the index is outside bounds.

source

pub fn binary_find_atom( &'a self, serial_number: usize, alternative_location: Option<&str> ) -> Option<AtomConformerResidueChainModel<'a>>

Get a reference to the specified atom. Its uniqueness is guaranteed by including the insertion_code, with its full hierarchy. The algorithm is based on binary search so it is faster than an exhaustive search, but the full structure is assumed to be sorted. This assumption can be enforced by using pdb.full_sort().

source

pub fn binary_find_atom_mut( &'a mut self, serial_number: usize, alternative_location: Option<&str> ) -> Option<AtomConformerResidueChainModelMut<'a>>

Get a mutable reference to the specified atom. Its uniqueness is guaranteed by including the insertion_code, with its full hierarchy. The algorithm is based on binary search so it is faster than an exhaustive search, but the full structure is assumed to be sorted. This assumption can be enforced by using pdb.full_sort().

source

pub fn find( &'a self, search: Search ) -> impl DoubleEndedIterator<Item = AtomConformerResidueChainModel<'a>> + '_

Find all hierarchies matching the given search. For more details see Search.

use pdbtbx::*;
let (pdb, errors) = open_pdb("example-pdbs/1ubq.pdb", StrictnessLevel::Loose).unwrap();
let selection = pdb.find(
    Term::ChainId("A".to_owned())
    & Term::ConformerName("GLY".to_owned())
    & Term::AtomSerialNumber(750)
);

Find all hierarchies matching the given information

source

pub fn find_mut( &'a mut self, search: Search ) -> impl DoubleEndedIterator<Item = AtomConformerResidueChainModelMut<'a>> + '_

Find all hierarchies matching the given search. For more details see Search.

source

pub fn models(&self) -> impl DoubleEndedIterator<Item = &Model> + '_

Get an iterator of references to Models making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_models(&self) -> impl ParallelIterator<Item = &Model> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to Models making up this PDB.

source

pub fn models_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Model> + '_

Get an iterator of mutable references to Models making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_models_mut( &mut self ) -> impl ParallelIterator<Item = &mut Model> + '_

Available on crate feature rayon only.

Get a parallel iterator of mutable references to Models making up this PDB.

source

pub fn chains(&self) -> impl DoubleEndedIterator<Item = &Chain> + '_

Get an iterator of references to Chains making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_chains(&self) -> impl ParallelIterator<Item = &Chain> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to Chains making up this PDB.

source

pub fn chains_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Chain> + '_

Get a iterator of mutable references to Chains making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_chains_mut( &mut self ) -> impl ParallelIterator<Item = &mut Chain> + '_

Available on crate feature rayon only.

Get a parallel iterator of mutable references to Chains making up this PDB.

source

pub fn residues(&self) -> impl DoubleEndedIterator<Item = &Residue> + '_

Get an iterator of references to Residues making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_residues(&self) -> impl ParallelIterator<Item = &Residue> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to Residues making up this PDB.

source

pub fn residues_mut( &mut self ) -> impl DoubleEndedIterator<Item = &mut Residue> + '_

Get an iterator of mutable references to Residues making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_residues_mut( &mut self ) -> impl ParallelIterator<Item = &mut Residue> + '_

Available on crate feature rayon only.

Get a parallel iterator of mutable references to Residues making up this PDB.

source

pub fn conformers(&self) -> impl DoubleEndedIterator<Item = &Conformer> + '_

Get an iterator of references to Conformers making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_conformers(&self) -> impl ParallelIterator<Item = &Conformer> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to Conformers making up this PDB.

source

pub fn conformers_mut( &mut self ) -> impl DoubleEndedIterator<Item = &mut Conformer> + '_

Get an iterator of mutable references to Conformers making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_conformers_mut( &mut self ) -> impl ParallelIterator<Item = &mut Conformer> + '_

Available on crate feature rayon only.

Get a parallel iterator of mutable references to Conformers making up this PDB.

source

pub fn atoms(&self) -> impl DoubleEndedIterator<Item = &Atom> + '_

Get an iterator of references to Atom making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_atoms(&self) -> impl ParallelIterator<Item = &Atom> + '_

Available on crate feature rayon only.

Get a parallel iterator of references to Atom making up this PDB.

source

pub fn atoms_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Atom> + '_

Get an iterator of mutable references to Atom making up this PDB. Double ended so iterating from the end is just as fast as from the start.

source

pub fn par_atoms_mut(&mut self) -> impl ParallelIterator<Item = &mut Atom> + '_

Available on crate feature rayon only.

Get a parallel iterator of mutable references to Atom making up this PDB.

source

pub fn atoms_with_hierarchy( &'a self ) -> impl DoubleEndedIterator<Item = AtomConformerResidueChainModel<'a>> + '_

Get an iterator of references to a struct containing all atoms with their hierarchy making up this PDB.

source

pub fn atoms_with_hierarchy_mut( &'a mut self ) -> impl DoubleEndedIterator<Item = AtomConformerResidueChainModelMut<'a>> + '_

Get an iterator of mutable references to a struct containing all atoms with their hierarchy making up this PDB.

source

pub fn remove_atoms_by<F>(&mut self, predicate: F)where F: Fn(&Atom) -> bool,

Remove all Atoms matching the given predicate. The predicate will be run on all Atoms. As this is done in place this is the fastest way to remove Atoms from this PDB.

source

pub fn remove_conformers_by<F>(&mut self, predicate: F)where F: Fn(&Conformer) -> bool,

Remove all Conformers matching the given predicate. The predicate will be run on all Conformers. As this is done in place this is the fastest way to remove Conformers from this PDB.

source

pub fn remove_residues_by<F>(&mut self, predicate: F)where F: Fn(&Residue) -> bool,

Remove all Residues matching the given predicate. The predicate will be run on all Residues. As this is done in place this is the fastest way to remove Residues from this PDB.

source

pub fn remove_chains_by<F>(&mut self, predicate: F)where F: Fn(&Chain) -> bool,

Remove all Residues matching the given predicate. The predicate will be run on all Residues. As this is done in place this is the fastest way to remove Residues from this PDB.

source

pub fn remove_models_by<F>(&mut self, predicate: F)where F: Fn(&Model) -> bool,

Remove all Chains matching the given predicate. The predicate will be run on all Chains. As this is done in place this is the fastest way to remove Chains from this PDB.

source

pub fn remove_model(&mut self, index: usize)

Remove the Model specified.

Complexity
  • Time: amortized O(n) where n is the number of models, best case O(1) if model is the last one.
  • Memory: O(1)
Arguments
  • index - the index of the Model to remove
Panics

Panics if the index is out of bounds.

source

pub fn remove_models_except(&mut self, idxs: &[usize]) -> Option<usize>

Remove all Models except for models specified by idxs.

Complexity
  • Time: O(n) where n is the number of models.
  • Memory: O(k) where k is the number of models to keep.
Arguments
  • idxs - the indices of the Models to keep
Returns

None if any of the indices are out of bounds. Some(usize) the number of models removed.

source

pub fn remove_all_models_except_first(&mut self) -> Option<usize>

Remove all Models except for the first one.

source

pub fn remove_model_serial_number(&mut self, serial_number: usize) -> bool

Remove the Model specified. It returns true if it found a matching Model and removed it. It removes the first matching Model from the list.

Arguments
  • serial_number - the serial number of the Model to remove
source

pub fn par_remove_model_serial_number(&mut self, serial_number: usize) -> bool

Available on crate feature rayon only.

Remove the Model specified. It returns true if it found a matching Model and removed it. It removes the first matching Model from the list. Done in parallel.

Arguments
  • serial_number - the serial number of the Model to remove
source

pub fn remove_empty(&mut self)

Remove all empty Models from this PDB, and all empty Chains from the Model, and all empty Residues from the Chains.

source

pub fn par_remove_empty(&mut self)

Available on crate feature rayon only.

Remove all empty Models from this PDB, and all empty Chains from the Model, and all empty Residues from the Chains. Done in parallel.

source

pub fn renumber(&mut self)

This renumbers all numbered structs in the PDB. So it renumbers models, atoms, residues, chains and MtriXs.

source

pub fn apply_transformation(&mut self, transformation: &TransformationMatrix)

Apply a transformation to the position of all atoms making up this PDB, the new position is immediately set.

source

pub fn par_apply_transformation( &mut self, transformation: &TransformationMatrix )

Available on crate feature rayon only.

Apply a transformation to the position of all atoms making up this PDB, the new position is immediately set. Done in parallel.

source

pub fn join(&mut self, other: PDB)

Joins two PDBs. If one has multiple models it extends the models of this PDB with the models of the other PDB. If this PDB does not have any models it moves the models of the other PDB to this PDB. If both have one model it moves all chains/residues/atoms from the model of the other PDB to the model of this PDB. Effectively the same as calling join on those models.

source

pub fn sort(&mut self)

Sort the Models of this PDB.

source

pub fn par_sort(&mut self)

Available on crate feature rayon only.

Sort the Models of this PDB in parallel.

source

pub fn full_sort(&mut self)

Sort all structs in this PDB.

source

pub fn par_full_sort(&mut self)

Available on crate feature rayon only.

Sort all structs in this PDB in parallel.

source

pub fn create_atom_rtree(&self) -> RTree<&Atom>

Available on crate feature rstar only.

Create an R star tree of Atoms which can be used for fast lookup of spatially close atoms. See the crate rstar for documentation on how to use the tree. (https://crates.io/crates/rstar)

Keep in mind that this creates a tree that is separate from the original PDB, so any changes to one of the data structures is not seen in the other data structure (until you generate a new tree of course).

source

pub fn create_hierarchy_rtree( &'a self ) -> RTree<AtomConformerResidueChainModel<'a>>

Available on crate feature rstar only.

Create an R star tree of structs containing Atoms and their hierarchies which can be used for fast lookup of spatial close atoms. See the crate rstar for documentation on how to use the tree. (https://crates.io/crates/rstar)

Keep in mind that this creates a tree that is separate from the original PDB, so any changes to one of the data structures is not seen in the other data structure (until you generate a new tree of course).

source

pub fn bounding_box(&self) -> ((f64, f64, f64), (f64, f64, f64))

Finds the square bounding box around the PDB. The first tuple is the bottom left point, lowest value for all dimensions for all points. The second tuple is the top right point, the highest value for all dimensions for all points.

source

pub fn bonds( &self ) -> impl DoubleEndedIterator<Item = (&Atom, &Atom, Bond)> + '_

Get the bonds in this PDB file. Runtime is O(bonds_count * 2 * atom_count) because it has to iterate over all atoms to prevent borrowing problems.

source

pub fn add_bond( &mut self, atom1: (usize, Option<&str>), atom2: (usize, Option<&str>), bond: Bond ) -> Option<()>

Add a bond of the given type to the list of bonds in this PDB. The atoms are selected by serial number and alternative location. It uses binary_find_atom in the background so the PDB should be sorted. If one of the atoms could not be found it returns None otherwise it will return Some(()).

Trait Implementations§

source§

impl Clone for PDB

source§

fn clone(&self) -> PDB

Returns a copy 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 Debug for PDB

source§

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

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

impl Default for PDB

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for PDB

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for PDB

source§

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

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

impl Extend<Model> for PDB

source§

fn extend<T: IntoIterator<Item = Model>>(&mut self, iter: T)

Extend the Models on this PDB by the given iterator of Models.

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 FromIterator<Model> for PDB

source§

fn from_iter<T: IntoIterator<Item = Model>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl PartialEq<PDB> for PDB

source§

fn eq(&self, other: &PDB) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for PDB

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for PDB

Auto Trait Implementations§

§

impl RefUnwindSafe for PDB

§

impl Send for PDB

§

impl Sync for PDB

§

impl Unpin for PDB

§

impl UnwindSafe for PDB

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,