pub struct BootstrapEnvironment { /* private fields */ }Expand description
Process values read once at the outward CLI boundary.
Implementations§
Source§impl BootstrapEnvironment
impl BootstrapEnvironment
Sourcepub fn new(
current_dir: impl Into<PathBuf>,
home_dir: Option<PathBuf>,
values: BTreeMap<String, String>,
) -> Self
pub fn new( current_dir: impl Into<PathBuf>, home_dir: Option<PathBuf>, values: BTreeMap<String, String>, ) -> Self
Creates a fully injected environment for hermetic embedding/tests.
Sourcepub fn from_process() -> Result<Self, CliFailure>
pub fn from_process() -> Result<Self, CliFailure>
Captures the process environment once for later hermetic resolution.
§Errors
Returns a configuration failure when the current directory is unavailable.
Trait Implementations§
Source§impl Clone for BootstrapEnvironment
impl Clone for BootstrapEnvironment
Source§impl Debug for BootstrapEnvironment
impl Debug for BootstrapEnvironment
Source§impl McpEnvironmentResolver for BootstrapEnvironment
impl McpEnvironmentResolver for BootstrapEnvironment
Source§fn resolve(
&self,
name: &str,
) -> Result<Option<McpEnvironmentValue>, McpEnvironmentError>
fn resolve( &self, name: &str, ) -> Result<Option<McpEnvironmentValue>, McpEnvironmentError>
Resolves one exact name at process-spawn time. Read more
Auto Trait Implementations§
impl Freeze for BootstrapEnvironment
impl RefUnwindSafe for BootstrapEnvironment
impl Send for BootstrapEnvironment
impl Sync for BootstrapEnvironment
impl Unpin for BootstrapEnvironment
impl UnsafeUnpin for BootstrapEnvironment
impl UnwindSafe for BootstrapEnvironment
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,
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