OverrideSystem

Struct OverrideSystem 

Source
pub struct OverrideSystem { /* private fields */ }
Expand description

Main override system that coordinates all components

Implementations§

Source§

impl OverrideSystem

Source

pub fn new(workspace_path: &Path) -> Result<Self>

Create a new override system for a workspace

Source

pub fn generate_key(&mut self, context: &FunctionContext) -> Result<OverrideKey>

Generate a stable key from context

Source

pub fn save_override( &self, key: OverrideKey, override_config: CommandOverride, context: &FunctionContext, ) -> Result<()>

Save an override with the given key

Source

pub fn save_override_with_validation( &self, key: OverrideKey, override_config: CommandOverride, context: &FunctionContext, command: &str, ) -> Result<()>

Save an override with validation

Source

pub fn resolve_override( &mut self, context: &FunctionContext, ) -> Result<Option<CommandOverride>>

Resolve an override from context

Source

pub fn resolve_with_strategy( &mut self, context: &FunctionContext, ) -> Result<Option<(CommandOverride, ResolutionStrategy)>>

Resolve override with strategy information

Source

pub fn preview_override( &self, params: PreviewParams<'_>, ) -> Result<OverridePreview>

Create a preview of changes

Source

pub fn list_all(&self) -> Result<Vec<OverrideEntry>>

List all overrides

Source

pub fn list_by_file(&self, file_path: &Path) -> Result<Vec<OverrideEntry>>

List overrides for a specific file

Source

pub fn delete_override(&self, key: &str) -> Result<bool>

Delete an override by key

Source

pub fn clear_all(&self) -> Result<()>

Clear all overrides

Source

pub fn clear_by_file(&self, file_path: &Path) -> Result<usize>

Clear overrides for a specific file

Source

pub fn export(&self) -> Result<String>

Export overrides for backup

Source

pub fn import(&self, data: &str) -> Result<usize>

Import overrides from backup

Source

pub fn debug_resolution( &mut self, context: &FunctionContext, ) -> Result<Vec<(OverrideEntry, ResolutionStrategy, f32)>>

Debug: Get resolution candidates

Source

pub fn get_function_context( &mut self, file_path: &Path, line: usize, column: Option<usize>, ) -> Result<FunctionContext>

Get function context from file position

Source

pub fn update_execution_status(&self, key: &str, success: bool) -> Result<()>

Update execution status of an override

Source

pub fn rollback_to_last_backup(&self) -> Result<()>

Rollback to last backup

Source

pub fn get_problematic_overrides( &self, failure_threshold: u32, ) -> Result<Vec<OverrideEntry>>

Get overrides that have failed multiple times

Source

pub fn should_auto_rollback(&self, key: &str, threshold: u32) -> Result<bool>

Check if an override should be auto-rolled back

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.