pub struct ImpactAnalysisEngine { /* private fields */ }Expand description
Impact analysis engine with two-step preview/confirm API
This engine enables safe confidence propagation by:
- Saving state snapshot before computing cascade
- Returning preview data for review
- Applying changes only after explicit confirmation
- Supporting revert within time window
Implementations§
Source§impl ImpactAnalysisEngine
impl ImpactAnalysisEngine
Sourcepub fn new(board: Arc<HypothesisBoard>, graph: Arc<BeliefGraph>) -> Self
pub fn new(board: Arc<HypothesisBoard>, graph: Arc<BeliefGraph>) -> Self
Create a new impact analysis engine
Sourcepub fn with_config(
board: Arc<HypothesisBoard>,
graph: Arc<BeliefGraph>,
config: PropagationConfig,
) -> Self
pub fn with_config( board: Arc<HypothesisBoard>, graph: Arc<BeliefGraph>, config: PropagationConfig, ) -> Self
Create engine with custom propagation config
Sourcepub fn with_page_size(self, page_size: usize) -> Self
pub fn with_page_size(self, page_size: usize) -> Self
Set custom page size for pagination
Sourcepub async fn preview(
&self,
start_hypothesis: HypothesisId,
new_confidence: Confidence,
) -> Result<CascadePreview>
pub async fn preview( &self, start_hypothesis: HypothesisId, new_confidence: Confidence, ) -> Result<CascadePreview>
Step 1: Preview cascade effects
Saves a snapshot before computing the cascade, then returns a preview showing all affected hypotheses.
Sourcepub async fn confirm(&self, preview_id: &PreviewId) -> Result<PropagationResult>
pub async fn confirm(&self, preview_id: &PreviewId) -> Result<PropagationResult>
Step 2: Confirm and apply changes from preview
Applies the confidence changes computed in the preview step. Returns error if preview_id not found or expired.
Sourcepub fn get_preview_page(
&self,
preview_id: &PreviewId,
page_number: usize,
) -> Result<PreviewPage>
pub fn get_preview_page( &self, preview_id: &PreviewId, page_number: usize, ) -> Result<PreviewPage>
Get a paginated page from a preview
Sourcepub async fn impact_radius(&self, start: HypothesisId) -> Result<usize>
pub async fn impact_radius(&self, start: HypothesisId) -> Result<usize>
Query impact radius (count of affected hypotheses)
Sourcepub async fn revert(&self, snapshot_id: &SnapshotId) -> Result<()>
pub async fn revert(&self, snapshot_id: &SnapshotId) -> Result<()>
Revert to a previous snapshot
Restores hypotheses and dependencies from the snapshot. Returns error if snapshot not found or expired.
Sourcepub async fn list_snapshots(&self) -> Vec<BeliefSnapshot>
pub async fn list_snapshots(&self) -> Vec<BeliefSnapshot>
List all active snapshots
Sourcepub async fn get_snapshot(&self, id: &SnapshotId) -> Option<BeliefSnapshot>
pub async fn get_snapshot(&self, id: &SnapshotId) -> Option<BeliefSnapshot>
Get snapshot data for inspection
Auto Trait Implementations§
impl Freeze for ImpactAnalysisEngine
impl !RefUnwindSafe for ImpactAnalysisEngine
impl Send for ImpactAnalysisEngine
impl Sync for ImpactAnalysisEngine
impl Unpin for ImpactAnalysisEngine
impl UnsafeUnpin for ImpactAnalysisEngine
impl !UnwindSafe for ImpactAnalysisEngine
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
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more