#[non_exhaustive]pub enum TargetPopulation {
AllObserved,
Treated,
Untreated,
Environment(EnvironmentId),
Predicate(PredicateExpr),
CustomDistribution(DistributionRef),
}Expand description
Target population for an effect query.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AllObserved
All observed units.
Treated
Treated units only.
Untreated
Untreated units only.
Environment(EnvironmentId)
Environment-restricted population.
Predicate(PredicateExpr)
Predicate-selected units (PredicateExpr).
CustomDistribution(DistributionRef)
Custom target distribution handle (weights via super::PopulationRegistry).
Implementations§
Source§impl TargetPopulation
impl TargetPopulation
Sourcepub fn resolve(
&self,
n: usize,
treatment: Option<&[f64]>,
registry: Option<&PopulationRegistry>,
) -> Result<PopulationSelection, QueryError>
pub fn resolve( &self, n: usize, treatment: Option<&[f64]>, registry: Option<&PopulationRegistry>, ) -> Result<PopulationSelection, QueryError>
Resolve this population over n rows.
treatment is required for Self::Treated / Self::Untreated (binary 0/1 column,
length n). Named predicates and custom distributions require registry.
§Errors
Missing registry bindings, shape mismatches, or unknown variants.
Trait Implementations§
Source§impl Clone for TargetPopulation
impl Clone for TargetPopulation
Source§fn clone(&self) -> TargetPopulation
fn clone(&self) -> TargetPopulation
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 TargetPopulation
impl Debug for TargetPopulation
impl Eq for TargetPopulation
Source§impl Hash for TargetPopulation
impl Hash for TargetPopulation
Source§impl PartialEq for TargetPopulation
impl PartialEq for TargetPopulation
impl StructuralPartialEq for TargetPopulation
Auto Trait Implementations§
impl Freeze for TargetPopulation
impl RefUnwindSafe for TargetPopulation
impl Send for TargetPopulation
impl Sync for TargetPopulation
impl Unpin for TargetPopulation
impl UnsafeUnpin for TargetPopulation
impl UnwindSafe for TargetPopulation
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