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§
type Chemical: Clone
type Pure: Clone + DeserializeOwned
type Binary: Clone + DeserializeOwned
Required Methods§
Sourcefn 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 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.
Sourcefn records(
&self,
) -> (&[Self::Chemical], &[SegmentRecord<Self::Pure>], &Option<Vec<BinaryRecord<String, Self::Binary>>>)
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§
Sourcefn from_json_segments<P>(
substances: &[&str],
file_pure: P,
file_segments: P,
file_binary: Option<P>,
identifier_option: IdentifierOption,
) -> Result<Self, ParameterError>
fn from_json_segments<P>( substances: &[&str], file_pure: P, file_segments: P, file_binary: Option<P>, identifier_option: IdentifierOption, ) -> Result<Self, ParameterError>
Creates parameters from segment information stored in json files.
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.