pub enum IntProvider {
Constant(i32),
Uniform {
min_inclusive: i32,
max_inclusive: i32,
},
BiasedToBottom {
min_inclusive: i32,
max_inclusive: i32,
},
VeryBiasedToBottom {
min_inclusive: i32,
max_inclusive: i32,
inner: i32,
},
Trapezoid {
min: i32,
max: i32,
plateau: i32,
},
ClampedNormal {
mean: f32,
deviation: f32,
min_inclusive: i32,
max_inclusive: i32,
},
Clamped {
source: Box<IntProvider>,
min_inclusive: i32,
max_inclusive: i32,
},
WeightedList {
distribution: Vec<WeightedIntProvider>,
},
}Expand description
An int-valued provider.
Mirrors vanilla’s IntProvider hierarchy used by feature placement and
feature configuration data.
Variants§
Constant(i32)
Always returns the same value.
Uniform
Uniform inclusive over [min_inclusive, max_inclusive].
BiasedToBottom
Biased toward the bottom.
VeryBiasedToBottom
Heavily biased toward the bottom.
Fields
Trapezoid
Sum of two uniform draws, symmetric triangle when plateau == 0.
ClampedNormal
Gaussian with given mean/deviation, clamped to [min_inclusive, max_inclusive].
Fields
Clamped
Clamps another provider to an inclusive range.
Fields
§
source: Box<IntProvider>Source provider.
WeightedList
Weighted provider selection.
Fields
§
distribution: Vec<WeightedIntProvider>Weighted alternatives.
Implementations§
Source§impl IntProvider
impl IntProvider
Trait Implementations§
Source§impl Clone for IntProvider
impl Clone for IntProvider
Source§fn clone(&self) -> IntProvider
fn clone(&self) -> IntProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 IntProvider
impl Debug for IntProvider
Source§impl<'de> Deserialize<'de> for IntProvider
impl<'de> Deserialize<'de> for IntProvider
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IntProvider
impl RefUnwindSafe for IntProvider
impl Send for IntProvider
impl Sync for IntProvider
impl Unpin for IntProvider
impl UnsafeUnpin for IntProvider
impl UnwindSafe for IntProvider
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