pub struct WeightedOption<T> {
pub weight: f64,
pub value: Option<T>,
}Expand description
An option value tagged with a weight (used for ranked alternatives).
Fields§
§weight: f64The weight (higher is better).
value: Option<T>The value, if present.
Implementations§
Trait Implementations§
Source§impl<T: Clone> Clone for WeightedOption<T>
impl<T: Clone> Clone for WeightedOption<T>
Source§fn clone(&self) -> WeightedOption<T>
fn clone(&self) -> WeightedOption<T>
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<T: Debug> Debug for WeightedOption<T>
impl<T: Debug> Debug for WeightedOption<T>
Source§impl<T: PartialEq> PartialEq for WeightedOption<T>
impl<T: PartialEq> PartialEq for WeightedOption<T>
impl<T> StructuralPartialEq for WeightedOption<T>
Auto Trait Implementations§
impl<T> Freeze for WeightedOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for WeightedOption<T>where
T: RefUnwindSafe,
impl<T> Send for WeightedOption<T>where
T: Send,
impl<T> Sync for WeightedOption<T>where
T: Sync,
impl<T> Unpin for WeightedOption<T>where
T: Unpin,
impl<T> UnsafeUnpin for WeightedOption<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for WeightedOption<T>where
T: UnwindSafe,
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