pub struct SamplerDatasetOptions {
pub replace_samples: bool,
pub size_config: SizeConfig,
pub rng_source: RngSource,
}Available on crate features
dataset and std 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 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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