pub struct ProportionLibrary { /* private fields */ }Expand description
A set of named proportion schemas.
Implementations§
Source§impl ProportionLibrary
impl ProportionLibrary
Sourcepub fn add(&mut self, schema: ProportionSchema)
pub fn add(&mut self, schema: ProportionSchema)
Add a schema to the library.
Sourcepub fn find(&self, name: &str) -> Option<&ProportionSchema>
pub fn find(&self, name: &str) -> Option<&ProportionSchema>
Find a schema by name (case-sensitive).
Sourcepub fn schemas(&self) -> &[ProportionSchema]
pub fn schemas(&self) -> &[ProportionSchema]
Return all schemas in the library.
Sourcepub fn closest(&self, params: &ParamState) -> Option<&ProportionSchema>
pub fn closest(&self, params: &ParamState) -> Option<&ProportionSchema>
Find the closest schema by L2 distance of ratio deviations from params.
Sourcepub fn analyze(
&self,
params: &ParamState,
schema_name: &str,
) -> Option<ProportionAnalysis>
pub fn analyze( &self, params: &ParamState, schema_name: &str, ) -> Option<ProportionAnalysis>
Analyze params against the named schema.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProportionLibrary
impl RefUnwindSafe for ProportionLibrary
impl Send for ProportionLibrary
impl Sync for ProportionLibrary
impl Unpin for ProportionLibrary
impl UnsafeUnpin for ProportionLibrary
impl UnwindSafe for ProportionLibrary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more