Struct SamplerDatasetOptions
pub struct SamplerDatasetOptions {
pub replace_samples: bool,
pub size_config: SizeConfig,
pub rng_source: RngSource,
}Expand description
Options to configure a SamplerDataset.
Fields§
§replace_samples: boolThe sampling mode.
size_config: SizeConfigThe size source of the wrapper relative to the dataset.
rng_source: RngSourceThe source of the random number generator.
Implementations§
§impl SamplerDatasetOptions
impl SamplerDatasetOptions
pub fn with_replace_samples(
self,
replace_samples: bool,
) -> SamplerDatasetOptions
pub fn with_replace_samples( self, replace_samples: bool, ) -> SamplerDatasetOptions
Set the replacement mode.
pub fn with_replacement(self) -> SamplerDatasetOptions
pub fn with_replacement(self) -> SamplerDatasetOptions
Set the replacement mode to WithReplacement.
pub fn without_replacement(self) -> SamplerDatasetOptions
pub fn without_replacement(self) -> SamplerDatasetOptions
Set the replacement mode to WithoutReplacement.
pub fn with_size<S>(self, source: S) -> SamplerDatasetOptionswhere
S: Into<SizeConfig>,
pub fn with_size<S>(self, source: S) -> SamplerDatasetOptionswhere
S: Into<SizeConfig>,
Set the size source.
pub fn with_source_size(self) -> SamplerDatasetOptions
pub fn with_source_size(self) -> SamplerDatasetOptions
Set the size to the size of the source.
pub fn with_fixed_size(self, size: usize) -> SamplerDatasetOptions
pub fn with_fixed_size(self, size: usize) -> SamplerDatasetOptions
Set the size to a fixed size.
pub fn with_size_ratio(self, size_ratio: f64) -> SamplerDatasetOptions
pub fn with_size_ratio(self, size_ratio: f64) -> SamplerDatasetOptions
Set the size to be a multiple of the ration and the source size.
pub fn with_rng<R>(self, rng: R) -> SamplerDatasetOptions
pub fn with_rng<R>(self, rng: R) -> SamplerDatasetOptions
Set the RngSource.
pub fn with_system_rng(self) -> SamplerDatasetOptions
pub fn with_system_rng(self) -> SamplerDatasetOptions
Use the system rng.
pub fn with_seed(self, seed: u64) -> SamplerDatasetOptions
pub fn with_seed(self, seed: u64) -> SamplerDatasetOptions
Use a rng, built from a seed.
Trait Implementations§
§impl Clone for SamplerDatasetOptions
impl Clone for SamplerDatasetOptions
§fn clone(&self) -> SamplerDatasetOptions
fn clone(&self) -> SamplerDatasetOptions
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 more§impl Debug for SamplerDatasetOptions
impl Debug for SamplerDatasetOptions
§impl Default for SamplerDatasetOptions
impl Default for SamplerDatasetOptions
§fn default() -> SamplerDatasetOptions
fn default() -> SamplerDatasetOptions
Returns the “default value” for a type. Read more
§impl<T> From<Option<T>> for SamplerDatasetOptionswhere
T: Into<SamplerDatasetOptions>,
impl<T> From<Option<T>> for SamplerDatasetOptionswhere
T: Into<SamplerDatasetOptions>,
§fn from(option: Option<T>) -> SamplerDatasetOptions
fn from(option: Option<T>) -> SamplerDatasetOptions
Converts to this type from the input type.
§impl From<usize> for SamplerDatasetOptions
impl From<usize> for SamplerDatasetOptions
§fn from(size: usize) -> SamplerDatasetOptions
fn from(size: usize) -> SamplerDatasetOptions
Converts to this type from the input type.
§impl PartialEq for SamplerDatasetOptions
impl PartialEq for SamplerDatasetOptions
impl StructuralPartialEq for SamplerDatasetOptions
Auto Trait Implementations§
impl Freeze for SamplerDatasetOptions
impl RefUnwindSafe for SamplerDatasetOptions
impl Send for SamplerDatasetOptions
impl Sync for SamplerDatasetOptions
impl Unpin for SamplerDatasetOptions
impl UnwindSafe for SamplerDatasetOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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