pub struct ScoringWeights {
pub throughput: f64,
pub compression_ratio: f64,
}Expand description
Scoring weights for plugin selection
Weights determine the relative importance of throughput vs compression ratio when selecting a plugin. Must sum to 1.0.
Fields§
§throughput: f64Weight for throughput (MB/s) - default 0.7 (70%)
compression_ratio: f64Weight for compression ratio - default 0.3 (30%)
Implementations§
Source§impl ScoringWeights
impl ScoringWeights
Sourcepub fn new(throughput: f64, compression_ratio: f64) -> Result<Self>
pub fn new(throughput: f64, compression_ratio: f64) -> Result<Self>
Create new scoring weights
§Errors
Returns an error if:
- Either weight is negative
- Weights don’t sum to 1.0 (within epsilon)
§Examples
use crush_core::ScoringWeights;
// Default 70/30 weighting
let weights = ScoringWeights::new(0.7, 0.3).expect("Valid weights");
// Balanced weighting
let balanced = ScoringWeights::new(0.5, 0.5).expect("Valid weights");Trait Implementations§
Source§impl Clone for ScoringWeights
impl Clone for ScoringWeights
Source§fn clone(&self) -> ScoringWeights
fn clone(&self) -> ScoringWeights
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScoringWeights
impl Debug for ScoringWeights
Source§impl Default for ScoringWeights
impl Default for ScoringWeights
impl Copy for ScoringWeights
Auto Trait Implementations§
impl Freeze for ScoringWeights
impl RefUnwindSafe for ScoringWeights
impl Send for ScoringWeights
impl Sync for ScoringWeights
impl Unpin for ScoringWeights
impl UnsafeUnpin for ScoringWeights
impl UnwindSafe for ScoringWeights
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