pub struct Environment { /* private fields */ }Expand description
Concrete execution/filesystem environment selected for a session.
This bundles the selected backend metadata together with the local runtime paths used by filesystem helpers.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn default_for_tests() -> Self
pub fn default_for_tests() -> Self
Builds a test-only local environment without configured sandbox helper paths.
Source§impl Environment
impl Environment
Sourcepub fn create(
exec_server_url: Option<String>,
local_runtime_paths: ExecServerRuntimePaths,
) -> Result<Self, ExecServerError>
pub fn create( exec_server_url: Option<String>, local_runtime_paths: ExecServerRuntimePaths, ) -> Result<Self, ExecServerError>
Builds an environment from the raw CODEX_EXEC_SERVER_URL value.
Sourcepub fn create_for_tests(
exec_server_url: Option<String>,
) -> Result<Self, ExecServerError>
pub fn create_for_tests( exec_server_url: Option<String>, ) -> Result<Self, ExecServerError>
Builds a test-only environment without configured sandbox helper paths.
pub fn is_remote(&self) -> bool
Sourcepub fn selected_capability_roots(&self) -> &[SelectedCapabilityRoot]
pub fn selected_capability_roots(&self) -> &[SelectedCapabilityRoot]
Returns capability roots supplied with the deferred environment’s ready signal.
Sourcepub fn subscribe_connection_state(
&self,
) -> Option<Receiver<EnvironmentConnectionState>>
pub fn subscribe_connection_state( &self, ) -> Option<Receiver<EnvironmentConnectionState>>
Subscribes to the current connection state for this remote environment.
pub fn local_runtime_paths(&self) -> Option<&ExecServerRuntimePaths>
Sourcepub async fn info(&self) -> Result<EnvironmentInfo, ExecServerError>
pub async fn info(&self) -> Result<EnvironmentInfo, ExecServerError>
Returns environment information from the selected execution/filesystem environment.
Sourcepub async fn discover_capability_roots(
&self,
params: CapabilityRootsDiscoverParams,
) -> Result<CapabilityRootsDiscoverResponse, ExecServerError>
pub async fn discover_capability_roots( &self, params: CapabilityRootsDiscoverParams, ) -> Result<CapabilityRootsDiscoverResponse, ExecServerError>
Discovers plugin and skill manifests through the environment’s high-level discovery API.
Sourcepub fn start_connecting(&self)
pub fn start_connecting(&self)
Starts connecting a remote environment without waiting for it. Requires an active Tokio runtime when background startup is supported.
Sourcepub fn startup_finished(&self) -> bool
pub fn startup_finished(&self) -> bool
Returns whether initial startup has either succeeded or permanently failed.
Sourcepub async fn wait_until_ready(&self) -> Result<(), ExecServerError>
pub async fn wait_until_ready(&self) -> Result<(), ExecServerError>
Waits for initial startup. A failed startup is never attempted again.
Sourcepub async fn status(&self) -> EnvironmentObservedStatus
pub async fn status(&self) -> EnvironmentObservedStatus
Returns the environment’s status without starting or recovering it.
Local environments are always ready. Remote environments with an
already-ready cached connection receive a fail-fast environment/status
probe; other remote states are returned from cached connection state
without waiting for startup or recovery.
pub fn get_exec_backend(&self) -> Arc<dyn ExecBackend>
pub fn get_http_client(&self) -> Arc<dyn HttpClient>
pub fn get_filesystem(&self) -> Arc<dyn ExecutorFileSystem>
Sourcepub fn get_filesystem_without_reconnect(&self) -> Arc<dyn ExecutorFileSystem>
pub fn get_filesystem_without_reconnect(&self) -> Arc<dyn ExecutorFileSystem>
Returns a filesystem view that fails instead of starting or waiting for a connection.
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Environment
impl !UnwindSafe for Environment
impl Freeze for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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>
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>
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)
&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)
&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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request