pub struct WeightedTable {
pub values: Vec<String>,
pub cumulative: Vec<f64>,
}Expand description
Pre-parsed value table for one_of_weighted. The cumulative
vector is normalised so the last entry is exactly 1.0, letting
the eval body locate the matching bucket with a single binary
search.
Fields§
§values: Vec<String>Output values in declaration order.
cumulative: Vec<f64>Cumulative weights, normalised to [0.0, 1.0]. The last entry is always 1.0.
Implementations§
Trait Implementations§
impl PolydatSetup for WeightedTable
Auto Trait Implementations§
impl Forget for WeightedTable
impl Freeze for WeightedTable
impl Move for WeightedTable
impl RefUnwindSafe for WeightedTable
impl Send for WeightedTablewhere
RawVecInner: Send,
impl Sync for WeightedTablewhere
RawVecInner: Sync,
impl Unpin for WeightedTable
impl UnsafeUnpin for WeightedTablewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<f64>: UnsafeUnpin,
impl UnwindSafe for WeightedTablewhere
RawVecInner: 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