pub struct SamplingConfig {
pub sample_size: SampleSize,
pub method: SamplingMethod,
pub confidence_level: f64,
}Expand description
Configuration for statistical sampling
Fields§
§sample_size: SampleSizeSample size strategy
method: SamplingMethodSampling method to use
confidence_level: f64Statistical confidence level (e.g., 0.95 for 95% confidence)
Implementations§
Source§impl SamplingConfig
impl SamplingConfig
Sourcepub fn new(sample_size: SampleSize, method: SamplingMethod) -> Self
pub fn new(sample_size: SampleSize, method: SamplingMethod) -> Self
Create a new sampling configuration
Sourcepub fn percentage(pct: f64) -> Self
pub fn percentage(pct: f64) -> Self
Create configuration for percentage-based sampling
Sourcepub fn determine_sample_size(&self, total_rows: usize) -> (usize, bool)
pub fn determine_sample_size(&self, total_rows: usize) -> (usize, bool)
Determine actual sample size for a given table
Returns (sample_size, should_sample) tuple
- sample_size: Number of rows to sample
- should_sample: Whether sampling is needed (false for small tables)
Trait Implementations§
Source§impl Clone for SamplingConfig
impl Clone for SamplingConfig
Source§fn clone(&self) -> SamplingConfig
fn clone(&self) -> SamplingConfig
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 SamplingConfig
impl Debug for SamplingConfig
Auto Trait Implementations§
impl Freeze for SamplingConfig
impl RefUnwindSafe for SamplingConfig
impl Send for SamplingConfig
impl Sync for SamplingConfig
impl Unpin for SamplingConfig
impl UnwindSafe for SamplingConfig
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