Trait ParameterHetero

Source
pub trait ParameterHetero: Sized {
    type Chemical: Clone;
    type Pure: Clone + DeserializeOwned;
    type Binary: Clone + DeserializeOwned;

    // Required methods
    fn from_segments<C: Clone + Into<Self::Chemical>>(
        chemical_records: Vec<C>,
        segment_records: Vec<SegmentRecord<Self::Pure>>,
        binary_segment_records: Option<Vec<BinaryRecord<String, Self::Binary>>>,
    ) -> Result<Self, ParameterError>;
    fn records(
        &self,
    ) -> (&[Self::Chemical], &[SegmentRecord<Self::Pure>], &Option<Vec<BinaryRecord<String, Self::Binary>>>);

    // Provided methods
    fn from_json_segments<P>(
        substances: &[&str],
        file_pure: P,
        file_segments: P,
        file_binary: Option<P>,
        identifier_option: IdentifierOption,
    ) -> Result<Self, ParameterError>
       where P: AsRef<Path>,
             ChemicalRecord: Into<Self::Chemical> { ... }
    fn subset(&self, component_list: &[usize]) -> Self { ... }
}
Expand description

Constructor methods for parameters for heterosegmented models.

Required Associated Types§

Required Methods§

Source

fn from_segments<C: Clone + Into<Self::Chemical>>( chemical_records: Vec<C>, segment_records: Vec<SegmentRecord<Self::Pure>>, binary_segment_records: Option<Vec<BinaryRecord<String, Self::Binary>>>, ) -> Result<Self, ParameterError>

Creates parameters from the molecular structure and segment information.

Source

fn records( &self, ) -> (&[Self::Chemical], &[SegmentRecord<Self::Pure>], &Option<Vec<BinaryRecord<String, Self::Binary>>>)

Return the original records that were used to construct the parameters.

Provided Methods§

Source

fn from_json_segments<P>( substances: &[&str], file_pure: P, file_segments: P, file_binary: Option<P>, identifier_option: IdentifierOption, ) -> Result<Self, ParameterError>
where P: AsRef<Path>, ChemicalRecord: Into<Self::Chemical>,

Creates parameters from segment information stored in json files.

Source

fn subset(&self, component_list: &[usize]) -> Self

Return a parameter set containing the subset of components specified in component_list.

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§