pub struct SchemeAdvancer { /* private fields */ }Expand description
Manages the lifecycle of multiple fraud schemes.
Implementations§
Source§impl SchemeAdvancer
impl SchemeAdvancer
Sourcepub fn new(config: SchemeAdvancerConfig) -> Self
pub fn new(config: SchemeAdvancerConfig) -> Self
Creates a new scheme advancer.
Sourcepub fn maybe_start_scheme(&mut self, context: &SchemeContext) -> Option<Uuid>
pub fn maybe_start_scheme(&mut self, context: &SchemeContext) -> Option<Uuid>
Potentially starts a new scheme based on probabilities.
Sourcepub fn advance_all(&mut self, context: &SchemeContext) -> Vec<SchemeAction>
pub fn advance_all(&mut self, context: &SchemeContext) -> Vec<SchemeAction>
Advances all active schemes and returns actions to execute.
Sourcepub fn record_label(
&mut self,
anomaly_id: impl Into<String>,
action: &SchemeAction,
)
pub fn record_label( &mut self, anomaly_id: impl Into<String>, action: &SchemeAction, )
Records a label for a scheme action.
Sourcepub fn get_labels(&self) -> &[MultiStageAnomalyLabel]
pub fn get_labels(&self) -> &[MultiStageAnomalyLabel]
Returns all generated labels.
Sourcepub fn get_completed_schemes(&self) -> &[CompletedScheme]
pub fn get_completed_schemes(&self) -> &[CompletedScheme]
Returns completed schemes.
Sourcepub fn active_scheme_count(&self) -> usize
pub fn active_scheme_count(&self) -> usize
Returns the number of active schemes.
Sourcepub fn completed_scheme_count(&self) -> usize
pub fn completed_scheme_count(&self) -> usize
Returns the number of completed schemes.
Sourcepub fn active_schemes_summary(&self) -> Vec<(Uuid, SchemeType, SchemeStatus)>
pub fn active_schemes_summary(&self) -> Vec<(Uuid, SchemeType, SchemeStatus)>
Returns active schemes summary.
Sourcepub fn get_scheme(&self, scheme_id: Uuid) -> Option<&dyn FraudScheme>
pub fn get_scheme(&self, scheme_id: Uuid) -> Option<&dyn FraudScheme>
Gets a specific scheme by ID.
Sourcepub fn get_statistics(&self) -> SchemeStatistics
pub fn get_statistics(&self) -> SchemeStatistics
Returns statistics about schemes.
Auto Trait Implementations§
impl Freeze for SchemeAdvancer
impl !RefUnwindSafe for SchemeAdvancer
impl Send for SchemeAdvancer
impl Sync for SchemeAdvancer
impl Unpin for SchemeAdvancer
impl !UnwindSafe for SchemeAdvancer
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