pub enum ShellOutcome {
Exit(i32),
Blocked,
}Expand description
Outcome of a shell execution, carried alongside the rendered text so the
MCP dispatch layer can surface failures in protocol metadata instead of
only as an [exit:N] text footer (GitHub #389: clients had no programmatic
way to detect ctx_shell failures and resorted to fragile regex matching).
Variants§
Exit(i32)
The command ran; carries its real exit code (0 = success).
Blocked
The command never ran (allowlist/validation rejection, or a precondition failure such as an unreadable/oversized input file).
Implementations§
Source§impl ShellOutcome
impl ShellOutcome
Sourcepub fn is_error(self) -> bool
pub fn is_error(self) -> bool
Whether this outcome must be reported as a tool error (isError: true).
Sourcepub fn structured(self) -> Option<Value>
pub fn structured(self) -> Option<Value>
Structured payload for CallToolResult.structuredContent, so guards
can read exitCode/blocked instead of parsing output text. Success
(exit 0) intentionally returns None — the happy path stays
token-neutral for clients that render structured content.
Trait Implementations§
Source§impl Clone for ShellOutcome
impl Clone for ShellOutcome
Source§fn clone(&self) -> ShellOutcome
fn clone(&self) -> ShellOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ShellOutcome
Source§impl Debug for ShellOutcome
impl Debug for ShellOutcome
impl Eq for ShellOutcome
Source§impl PartialEq for ShellOutcome
impl PartialEq for ShellOutcome
impl StructuralPartialEq for ShellOutcome
Auto Trait Implementations§
impl Freeze for ShellOutcome
impl RefUnwindSafe for ShellOutcome
impl Send for ShellOutcome
impl Sync for ShellOutcome
impl Unpin for ShellOutcome
impl UnsafeUnpin for ShellOutcome
impl UnwindSafe for ShellOutcome
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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