pub struct ExecutionToolContext { /* private fields */ }Expand description
The context handed to a built-in tool’s execute. Mirrors TS
ExecutionToolContext.
env is the read-only view for read/bash; mutating_env is Some when the
context was built with a mutation-capable env (write/edit use it to reach
the per-canonical-path queue). Callers conventionally wrap an
OsExecutionEnv or InMemoryExecutionEnv (which implement both traits)
via ExecutionToolContext::new.
Implementations§
Source§impl ExecutionToolContext
impl ExecutionToolContext
Sourcepub fn new(
env: Arc<dyn ExecutionEnv>,
mutating_env: Option<Arc<dyn MutatingEnv>>,
) -> Self
pub fn new( env: Arc<dyn ExecutionEnv>, mutating_env: Option<Arc<dyn MutatingEnv>>, ) -> Self
Build a context from a mutation-capable env. The env is stored both as
Arc<dyn ExecutionEnv> (for read/bash) and Arc<dyn MutatingEnv> (for
write/edit). The two arcs point at the same allocation when the caller
passes a single concrete env.
pub fn env(&self) -> &Arc<dyn ExecutionEnv> ⓘ
pub fn mutating_env(&self) -> Option<&Arc<dyn MutatingEnv>>
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutionToolContext
impl !UnwindSafe for ExecutionToolContext
impl Freeze for ExecutionToolContext
impl Send for ExecutionToolContext
impl Sync for ExecutionToolContext
impl Unpin for ExecutionToolContext
impl UnsafeUnpin for ExecutionToolContext
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> 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