pub struct RealAppEffectHandler { /* private fields */ }Expand description
Real effect handler that executes actual side effects.
This implementation performs real I/O operations including:
- Filesystem operations via
std::fs - Git operations via
crate::git_helpers - Environment variable access via
std::env - Working directory changes via
std::env::set_current_dir
§Example
ⓘ
use ralph_workflow::app::effect_handler::RealAppEffectHandler;
use ralph_workflow::app::effect::{AppEffect, AppEffectHandler};
let mut handler = RealAppEffectHandler::new();
let result = handler.execute(AppEffect::PathExists {
path: PathBuf::from("Cargo.toml"),
});Implementations§
Source§impl RealAppEffectHandler
impl RealAppEffectHandler
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new handler without a workspace root.
Paths will be used as-is, relative to the current working directory.
Sourcepub fn with_workspace_root(root: PathBuf) -> Self
pub fn with_workspace_root(root: PathBuf) -> Self
Create a new handler with a specific workspace root.
All relative paths in effects will be resolved against this root.
§Arguments
root- The workspace root directory for path resolution.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RealAppEffectHandler
impl RefUnwindSafe for RealAppEffectHandler
impl Send for RealAppEffectHandler
impl Sync for RealAppEffectHandler
impl Unpin for RealAppEffectHandler
impl UnwindSafe for RealAppEffectHandler
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> 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