pub struct McpSubstrate { /* private fields */ }Implementations§
Source§impl McpSubstrate
impl McpSubstrate
Trait Implementations§
Source§impl Substrate for McpSubstrate
impl Substrate for McpSubstrate
Source§fn run_command<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 str,
timeout_s: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_command<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 str,
timeout_s: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run a one-shot command, returning stdout/stderr/exit_code.
Source§fn read_text<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_text<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a UTF-8 text file in full.
Source§fn write_text<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_text<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
content: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Write (truncate) a UTF-8 text file.
Source§fn path_state<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = PathState> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn path_state<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
) -> Pin<Box<dyn Future<Output = PathState> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Determine whether
path exists without requiring it to be valid UTF-8.
The default is intentionally unknown: custom substrates can retain their
existing trait implementation, while guarded writes fail closed until
the adapter supplies a trustworthy presence check.Source§fn read_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
offset: Option<u64>,
len: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
offset: Option<u64>,
len: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read raw bytes, optionally a window
[offset, offset+len).Source§fn write_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 str,
bytes: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Write (truncate) raw bytes.
fn pty_start<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pty_input<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
data: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pty_read<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pty_resize<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
rows: u16,
cols: u16,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pty_kill<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn is_local(&self) -> bool
fn is_local(&self) -> bool
Whether this substrate is the host process itself. Convenience tools
(
list_dir/find_files/grep_files) that walk a directory tree use
this to keep their byte-identical host-fs implementation on the local
path; non-local environments fall back to composing on run_command.Source§fn display_path(&self, path: &str) -> String
fn display_path(&self, path: &str) -> String
How a path should appear in tool-result metadata for this environment.
Pure/synchronous; no I/O. The default echoes the input unchanged. The
local environment overrides this to reproduce the historic behavior of
reporting the resolved absolute path (relative paths joined to the host
CWD). Not a capability — just display canonicalization.
Auto Trait Implementations§
impl !RefUnwindSafe for McpSubstrate
impl !UnwindSafe for McpSubstrate
impl Freeze for McpSubstrate
impl Send for McpSubstrate
impl Sync for McpSubstrate
impl Unpin for McpSubstrate
impl UnsafeUnpin for McpSubstrate
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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