pub enum ShellEffect {
Edit,
Search,
Read,
Other,
}Expand description
What a shell command does to the working tree, as far as its text shows. Agents edit
through the shell as often as through edit tools (cat > f, sed -i, a heredoc script
that opens a file for writing), so orientation cannot end only at an Edit call.
use majordomus_cli::economics::usage::{shell_effect, ShellEffect};
let effects = ["rg todo src", "head -5 a.rs", "cargo test", "cp a.rs b.rs"].map(shell_effect);
assert_eq!(
effects,
[ShellEffect::Search, ShellEffect::Read, ShellEffect::Other, ShellEffect::Edit]
);Variants§
Edit
Writes a file.
Search
Searches (grep, find, ls, git ls-files).
Read
Reads a file (cat, head, tail, sed -n).
Other
Anything else: running tests, git status, …
Trait Implementations§
Source§impl Clone for ShellEffect
impl Clone for ShellEffect
Source§fn clone(&self) -> ShellEffect
fn clone(&self) -> ShellEffect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ShellEffect
Source§impl Debug for ShellEffect
impl Debug for ShellEffect
impl Eq for ShellEffect
Source§impl PartialEq for ShellEffect
impl PartialEq for ShellEffect
Source§fn eq(&self, other: &ShellEffect) -> bool
fn eq(&self, other: &ShellEffect) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ShellEffect
Auto Trait Implementations§
impl Freeze for ShellEffect
impl RefUnwindSafe for ShellEffect
impl Send for ShellEffect
impl Sync for ShellEffect
impl Unpin for ShellEffect
impl UnsafeUnpin for ShellEffect
impl UnwindSafe for ShellEffect
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.