pub enum AppEffect {
Show 30 variants
SetCurrentDir {
path: PathBuf,
},
WriteFile {
path: PathBuf,
content: String,
},
ReadFile {
path: PathBuf,
},
DeleteFile {
path: PathBuf,
},
CreateDir {
path: PathBuf,
},
PathExists {
path: PathBuf,
},
SetReadOnly {
path: PathBuf,
readonly: bool,
},
GitRequireRepo,
GitGetRepoRoot,
GitGetHeadOid,
GitDiff,
GitDiffFrom {
start_oid: String,
},
GitDiffFromStart,
GitSnapshot,
GitAddAll,
GitCommit {
message: String,
user_name: Option<String>,
user_email: Option<String>,
},
GitSaveStartCommit,
GitResetStartCommit,
GitRebaseOnto {
upstream_branch: String,
},
GitGetConflictedFiles,
GitContinueRebase,
GitAbortRebase,
GitGetDefaultBranch,
GitIsMainBranch,
GetEnvVar {
name: String,
},
SetEnvVar {
name: String,
value: String,
},
LogInfo {
message: String,
},
LogSuccess {
message: String,
},
LogWarn {
message: String,
},
LogError {
message: String,
},
}Expand description
App-level effects for CLI operations.
Each variant represents a side effect that can occur during CLI operations. Effects are data structures that describe what should happen without actually performing the operation.
§Categories
Effects are organized into logical categories:
- Working Directory: Process working directory management
- Filesystem: File and directory operations
- Git: Version control operations
- Environment: Environment variable access
- Logging: User-facing output
Variants§
SetCurrentDir
Set the current working directory for the process.
WriteFile
Write content to a file, creating it if it doesn’t exist.
ReadFile
Read the contents of a file.
DeleteFile
Delete a file.
CreateDir
Create a directory and all parent directories as needed.
PathExists
Check if a path exists.
SetReadOnly
Set or clear the read-only flag on a file.
GitRequireRepo
Verify that we’re in a git repository.
GitGetRepoRoot
Get the root directory of the git repository.
GitGetHeadOid
Get the OID (object identifier) of HEAD.
GitDiff
Get the diff of uncommitted changes.
GitDiffFrom
Get the diff from a specific commit OID to HEAD.
GitDiffFromStart
Get the diff from the saved start commit to HEAD.
GitSnapshot
Create a snapshot of the current state (stash-like operation).
GitAddAll
Stage all changes for commit.
GitCommit
Create a commit with the given message.
Fields
GitSaveStartCommit
Save the current HEAD as the start commit reference.
GitResetStartCommit
Reset the start commit reference to the merge-base.
GitRebaseOnto
Rebase the current branch onto an upstream branch.
GitGetConflictedFiles
Get the list of files with merge conflicts.
GitContinueRebase
Continue an in-progress rebase after conflicts are resolved.
GitAbortRebase
Abort an in-progress rebase.
GitGetDefaultBranch
Get the default branch name (main or master).
GitIsMainBranch
Check if the current branch is main or master.
GetEnvVar
Get the value of an environment variable.
SetEnvVar
Set an environment variable.
LogInfo
Log an informational message.
LogSuccess
Log a success message.
LogWarn
Log a warning message.
LogError
Log an error message.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppEffect
impl<'de> Deserialize<'de> for AppEffect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for AppEffect
Auto Trait Implementations§
impl Freeze for AppEffect
impl RefUnwindSafe for AppEffect
impl Send for AppEffect
impl Sync for AppEffect
impl Unpin for AppEffect
impl UnwindSafe for AppEffect
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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