pub struct BashState {
pub cwd: PathBuf,
pub workspace_root: PathBuf,
pub current_thread_id: String,
pub mode: Modes,
pub bash_command_mode: BashCommandMode,
pub file_edit_mode: FileEditMode,
pub write_if_empty_mode: WriteIfEmptyMode,
pub whitelist_for_overwrite: HashMap<String, FileWhitelistData>,
pub terminal_state: TerminalState,
pub pty_shell: Arc<Mutex<Option<PtyShell>>>,
pub initialized: bool,
}Fields§
§cwd: PathBuf§workspace_root: PathBuf§current_thread_id: String§mode: Modes§bash_command_mode: BashCommandMode§file_edit_mode: FileEditMode§write_if_empty_mode: WriteIfEmptyMode§whitelist_for_overwrite: HashMap<String, FileWhitelistData>§terminal_state: TerminalState§pty_shell: Arc<Mutex<Option<PtyShell>>>§initialized: boolImplementations§
Source§impl BashState
impl BashState
pub fn new() -> Self
pub async fn init_pty_shell(&mut self) -> Result<()>
pub fn update_cwd(&mut self, path: &Path) -> Result<()>
pub fn update_workspace_root(&mut self, path: &Path) -> Result<()>
pub fn is_command_allowed(&self, command: &str) -> bool
pub fn is_file_edit_allowed(&self, path: &str) -> bool
pub fn is_file_write_allowed(&self, path: &str) -> bool
pub fn get_mode_violation_message(&self, op: &str, _target: &str) -> String
pub fn save_state_to_disk(&self) -> Result<()>
pub fn snapshot(&self) -> BashStateSnapshot
pub fn apply_snapshot(&mut self, snapshot: &BashStateSnapshot)
pub fn load_state_from_disk(&mut self, thread_id: &str) -> Result<bool>
pub fn new_with_thread_id(thread_id: Option<&str>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BashState
impl !RefUnwindSafe for BashState
impl Send for BashState
impl Sync for BashState
impl Unpin for BashState
impl UnsafeUnpin for BashState
impl !UnwindSafe for BashState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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