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 !RefUnwindSafe for SchemeAdvancer
impl !UnwindSafe for SchemeAdvancer
impl Freeze for SchemeAdvancer
impl Send for SchemeAdvancer
impl Sync for SchemeAdvancer
impl Unpin for SchemeAdvancer
impl UnsafeUnpin 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
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.