Enum feos_core::parameter::ChemicalRecord
source · [−]pub enum ChemicalRecord {
List {
identifier: Identifier,
segments: Vec<String>,
bonds: Vec<[usize; 2]>,
},
Count {
identifier: Identifier,
segments: HashMap<String, f64>,
bonds: HashMap<[String; 2], f64>,
},
}Expand description
Chemical information of a substance.
Variants
List
Count
Implementations
sourceimpl ChemicalRecord
impl ChemicalRecord
sourcepub fn new(
identifier: Identifier,
segments: Vec<String>,
bonds: Option<Vec<[usize; 2]>>
) -> ChemicalRecord
pub fn new(
identifier: Identifier,
segments: Vec<String>,
bonds: Option<Vec<[usize; 2]>>
) -> ChemicalRecord
Create a new ChemicalRecord.
If no bonds are given, the molecule is assumed to be linear.
sourcepub fn new_count(
identifier: Identifier,
segments: HashMap<String, f64>,
bonds: Option<HashMap<[String; 2], f64>>
) -> ChemicalRecord
pub fn new_count(
identifier: Identifier,
segments: HashMap<String, f64>,
bonds: Option<HashMap<[String; 2], f64>>
) -> ChemicalRecord
Create a new ChemicalRecord from a segment count.
pub fn segments(&self) -> Either<&Vec<String>, &HashMap<String, f64>>
pub fn identifier(&self) -> &Identifier
sourcepub fn segment_count<M: Clone, I: Clone>(
&self,
segment_records: &[SegmentRecord<M, I>]
) -> Result<HashMap<SegmentRecord<M, I>, f64>, ParameterError>
pub fn segment_count<M: Clone, I: Clone>(
&self,
segment_records: &[SegmentRecord<M, I>]
) -> Result<HashMap<SegmentRecord<M, I>, f64>, ParameterError>
Count the number of occurences of each individual segment in the chemical record.
The map contains the segment record as key and the count as (float) value.
sourcepub fn segment_id_count(&self) -> Cow<'_, HashMap<String, f64>>
pub fn segment_id_count(&self) -> Cow<'_, HashMap<String, f64>>
Count the number of occurences of each individual segment identifier in the chemical record.
The map contains the segment identifier as key and the count as (float) value.
sourcepub fn segment_and_bond_count(
&self
) -> (Cow<'_, HashMap<String, f64>>, Cow<'_, HashMap<[String; 2], f64>>)
pub fn segment_and_bond_count(
&self
) -> (Cow<'_, HashMap<String, f64>>, Cow<'_, HashMap<[String; 2], f64>>)
Count the number of occurences of each individual segment identifier and each pair of identifiers for every bond in the chemical record.
sourcepub fn segment_and_bond_list(
&self
) -> Result<(&Vec<String>, &Vec<[usize; 2]>), ParameterError>
pub fn segment_and_bond_list(
&self
) -> Result<(&Vec<String>, &Vec<[usize; 2]>), ParameterError>
Return the full segment and bond information for the molecule if possible.
sourcepub fn segment_map<M: Clone, I: Clone>(
&self,
segment_records: &[SegmentRecord<M, I>]
) -> Result<HashMap<String, SegmentRecord<M, I>>, ParameterError>
pub fn segment_map<M: Clone, I: Clone>(
&self,
segment_records: &[SegmentRecord<M, I>]
) -> Result<HashMap<String, SegmentRecord<M, I>>, ParameterError>
Build a HashMap from SegmentRecords for the segments.
The map contains the segment identifier (String) as key and the SegmentRecord as value.
Trait Implementations
sourceimpl Clone for ChemicalRecord
impl Clone for ChemicalRecord
sourcefn clone(&self) -> ChemicalRecord
fn clone(&self) -> ChemicalRecord
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ChemicalRecord
impl Debug for ChemicalRecord
sourceimpl<'de> Deserialize<'de> for ChemicalRecord
impl<'de> Deserialize<'de> for ChemicalRecord
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for ChemicalRecord
impl Display for ChemicalRecord
sourceimpl Serialize for ChemicalRecord
impl Serialize for ChemicalRecord
Auto Trait Implementations
impl RefUnwindSafe for ChemicalRecord
impl Send for ChemicalRecord
impl Sync for ChemicalRecord
impl Unpin for ChemicalRecord
impl UnwindSafe for ChemicalRecord
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more