pub struct DryRunContext { /* private fields */ }Expand description
Dry-run execution context that captures all simulated changes
Implementations§
Source§impl DryRunContext
impl DryRunContext
Sourcepub fn simulate_file_write(
&mut self,
path: impl AsRef<Path>,
content: &str,
mode: Option<u32>,
)
pub fn simulate_file_write( &mut self, path: impl AsRef<Path>, content: &str, mode: Option<u32>, )
Simulate a file write
Sourcepub fn simulate_file_modify(
&mut self,
path: impl AsRef<Path>,
before: &str,
after: &str,
)
pub fn simulate_file_modify( &mut self, path: impl AsRef<Path>, before: &str, after: &str, )
Simulate a file modification
Sourcepub fn simulate_file_delete(&mut self, path: impl AsRef<Path>, content: &str)
pub fn simulate_file_delete(&mut self, path: impl AsRef<Path>, content: &str)
Simulate a file deletion
Sourcepub fn simulate_package_install(&mut self, name: &str, version: Option<&str>)
pub fn simulate_package_install(&mut self, name: &str, version: Option<&str>)
Simulate package installation
Sourcepub fn simulate_package_remove(&mut self, name: &str)
pub fn simulate_package_remove(&mut self, name: &str)
Simulate package removal
Sourcepub fn simulate_service_enable(&mut self, name: &str)
pub fn simulate_service_enable(&mut self, name: &str)
Simulate service enable
Sourcepub fn simulate_service_start(&mut self, name: &str)
pub fn simulate_service_start(&mut self, name: &str)
Simulate service start
Sourcepub fn simulate_add_to_group(&mut self, user: &str, group: &str)
pub fn simulate_add_to_group(&mut self, user: &str, group: &str)
Simulate adding user to group
Sourcepub fn log_step(&mut self, step_id: &str, step_name: &str, description: &str)
pub fn log_step(&mut self, step_id: &str, step_name: &str, description: &str)
Log a simulation step
Sourcepub fn log_step_failure(&mut self, step_id: &str, step_name: &str, reason: &str)
pub fn log_step_failure(&mut self, step_id: &str, step_name: &str, reason: &str)
Log a step that would fail
Sourcepub fn file_changes(&self) -> impl Iterator<Item = &FileChange>
pub fn file_changes(&self) -> impl Iterator<Item = &FileChange>
Get file changes
Sourcepub fn package_operations(&self) -> &[PackageOperation]
pub fn package_operations(&self) -> &[PackageOperation]
Get package operations
Sourcepub fn service_operations(&self) -> &[ServiceOperation]
pub fn service_operations(&self) -> &[ServiceOperation]
Get service operations
Sourcepub fn user_group_operations(&self) -> &[UserGroupOperation]
pub fn user_group_operations(&self) -> &[UserGroupOperation]
Get user/group operations
Sourcepub fn simulation_log(&self) -> &[SimulationEntry]
pub fn simulation_log(&self) -> &[SimulationEntry]
Get simulation log
Sourcepub fn generate_diff(&self) -> DiffPreview
pub fn generate_diff(&self) -> DiffPreview
Generate a complete diff preview
Sourcepub fn summary(&self) -> DryRunSummary
pub fn summary(&self) -> DryRunSummary
Get summary statistics
Trait Implementations§
Source§impl Debug for DryRunContext
impl Debug for DryRunContext
Source§impl Default for DryRunContext
impl Default for DryRunContext
Source§fn default() -> DryRunContext
fn default() -> DryRunContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DryRunContext
impl RefUnwindSafe for DryRunContext
impl Send for DryRunContext
impl Sync for DryRunContext
impl Unpin for DryRunContext
impl UnsafeUnpin for DryRunContext
impl UnwindSafe for DryRunContext
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<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>
Converts
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>
Converts
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