pub struct SamplerDatasetOptions {
pub replace_samples: bool,
pub size_config: SizeConfig,
pub rng_source: RngSource,
}Available on crate features
std and dataset only.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§
Source§impl SamplerDatasetOptions
impl SamplerDatasetOptions
Sourcepub fn with_replace_samples(
self,
replace_samples: bool,
) -> SamplerDatasetOptions
pub fn with_replace_samples( self, replace_samples: bool, ) -> SamplerDatasetOptions
Set the replacement mode.
Sourcepub fn with_replacement(self) -> SamplerDatasetOptions
pub fn with_replacement(self) -> SamplerDatasetOptions
Set the replacement mode to WithReplacement.
Sourcepub fn without_replacement(self) -> SamplerDatasetOptions
pub fn without_replacement(self) -> SamplerDatasetOptions
Set the replacement mode to WithoutReplacement.
Sourcepub 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.
Sourcepub fn with_source_size(self) -> SamplerDatasetOptions
pub fn with_source_size(self) -> SamplerDatasetOptions
Set the size to the size of the source.
Sourcepub fn with_fixed_size(self, size: usize) -> SamplerDatasetOptions
pub fn with_fixed_size(self, size: usize) -> SamplerDatasetOptions
Set the size to a fixed size.
Sourcepub 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.
Sourcepub fn with_rng<R>(self, rng: R) -> SamplerDatasetOptions
pub fn with_rng<R>(self, rng: R) -> SamplerDatasetOptions
Set the RngSource.
Sourcepub fn with_system_rng(self) -> SamplerDatasetOptions
pub fn with_system_rng(self) -> SamplerDatasetOptions
Use the system rng.
Sourcepub fn with_seed(self, seed: u64) -> SamplerDatasetOptions
pub fn with_seed(self, seed: u64) -> SamplerDatasetOptions
Use a rng, built from a seed.
Trait Implementations§
Source§impl Clone for SamplerDatasetOptions
impl Clone for SamplerDatasetOptions
Source§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 moreSource§impl Debug for SamplerDatasetOptions
impl Debug for SamplerDatasetOptions
Source§impl Default for SamplerDatasetOptions
impl Default for SamplerDatasetOptions
Source§fn default() -> SamplerDatasetOptions
fn default() -> SamplerDatasetOptions
Returns the “default value” for a type. Read more
Source§impl<T> From<Option<T>> for SamplerDatasetOptionswhere
T: Into<SamplerDatasetOptions>,
impl<T> From<Option<T>> for SamplerDatasetOptionswhere
T: Into<SamplerDatasetOptions>,
Source§fn from(option: Option<T>) -> SamplerDatasetOptions
fn from(option: Option<T>) -> SamplerDatasetOptions
Converts to this type from the input type.
Source§impl From<usize> for SamplerDatasetOptions
impl From<usize> for SamplerDatasetOptions
Source§fn from(size: usize) -> SamplerDatasetOptions
fn from(size: usize) -> SamplerDatasetOptions
Converts to this type from the input type.
Source§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