pub struct SegmentedCustomerPool {
pub customers: Vec<SegmentedCustomer>,
pub statistics: SegmentStatistics,
/* private fields */
}Expand description
Pool of segmented customers.
Fields§
§customers: Vec<SegmentedCustomer>All segmented customers
statistics: SegmentStatisticsPool statistics
Implementations§
Source§impl SegmentedCustomerPool
impl SegmentedCustomerPool
Sourcepub fn add_customer(&mut self, customer: SegmentedCustomer)
pub fn add_customer(&mut self, customer: SegmentedCustomer)
Add a customer to the pool.
Sourcepub fn by_segment(
&self,
segment: CustomerValueSegment,
) -> Vec<&SegmentedCustomer>
pub fn by_segment( &self, segment: CustomerValueSegment, ) -> Vec<&SegmentedCustomer>
Get customers by segment.
Sourcepub fn by_lifecycle_stage(&self, stage_name: &str) -> Vec<&SegmentedCustomer>
pub fn by_lifecycle_stage(&self, stage_name: &str) -> Vec<&SegmentedCustomer>
Get customers by lifecycle stage.
Sourcepub fn at_risk_customers(&self) -> Vec<&SegmentedCustomer>
pub fn at_risk_customers(&self) -> Vec<&SegmentedCustomer>
Get at-risk customers.
Sourcepub fn high_value_customers(&self) -> Vec<&SegmentedCustomer>
pub fn high_value_customers(&self) -> Vec<&SegmentedCustomer>
Get high-value customers.
Sourcepub fn rebuild_indexes(&mut self)
pub fn rebuild_indexes(&mut self)
Rebuild indexes (call after deserialization).
Sourcepub fn calculate_statistics(&mut self)
pub fn calculate_statistics(&mut self)
Calculate pool statistics.
Sourcepub fn check_segment_distribution(&self) -> Vec<String>
pub fn check_segment_distribution(&self) -> Vec<String>
Check segment distribution against targets.
Trait Implementations§
Source§impl Clone for SegmentedCustomerPool
impl Clone for SegmentedCustomerPool
Source§fn clone(&self) -> SegmentedCustomerPool
fn clone(&self) -> SegmentedCustomerPool
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 SegmentedCustomerPool
impl Debug for SegmentedCustomerPool
Source§impl Default for SegmentedCustomerPool
impl Default for SegmentedCustomerPool
Source§fn default() -> SegmentedCustomerPool
fn default() -> SegmentedCustomerPool
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SegmentedCustomerPool
impl<'de> Deserialize<'de> for SegmentedCustomerPool
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SegmentedCustomerPool
impl RefUnwindSafe for SegmentedCustomerPool
impl Send for SegmentedCustomerPool
impl Sync for SegmentedCustomerPool
impl Unpin for SegmentedCustomerPool
impl UnwindSafe for SegmentedCustomerPool
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