Trait SegmentCount

Source
pub trait SegmentCount {
    type Count: Copy + ValueInto<f64>;

    // Required methods
    fn identifier(&self) -> Cow<'_, Identifier>;
    fn segment_count(&self) -> Cow<'_, HashMap<String, Self::Count>>;

    // Provided method
    fn segment_map<M: Clone>(
        &self,
        segment_records: &[SegmentRecord<M>],
    ) -> Result<HashMap<SegmentRecord<M>, Self::Count>, ParameterError> { ... }
}
Expand description

Trait that enables parameter generation from generic molecular representations.

Required Associated Types§

Required Methods§

Source

fn identifier(&self) -> Cow<'_, Identifier>

Source

fn segment_count(&self) -> Cow<'_, HashMap<String, Self::Count>>

Count the number of occurences of each individual segment identifier in the molecule.

The map contains the segment identifier as key and the count as value.

Provided Methods§

Source

fn segment_map<M: Clone>( &self, segment_records: &[SegmentRecord<M>], ) -> Result<HashMap<SegmentRecord<M>, Self::Count>, ParameterError>

Count the number of occurences of each individual segment in the molecule.

The map contains the segment record as key and the count as value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§