pub struct NativeRuntime { /* private fields */ }Expand description
Host command runtime; unrestricted unless configured with an OS sandbox.
Implementations§
Source§impl NativeRuntime
impl NativeRuntime
Sourcepub fn session_limits(self, limits: SessionLimits) -> Self
pub fn session_limits(self, limits: SessionLimits) -> Self
Configures bounded session resources and opt-in interaction capabilities.
Source§impl NativeRuntime
impl NativeRuntime
Sourcepub fn build_shell_command(command: &str) -> Command
pub fn build_shell_command(command: &str) -> Command
Builds the platform shell command used to execute a command string.
Sourcepub fn new(workspace: PathBuf) -> Self
pub fn new(workspace: PathBuf) -> Self
Creates a native runtime whose default working directory is workspace.
Request metadata can select a directory inside this root, but cannot add a new root. A host that has independently authorized another directory can construct a separate runtime for that call. This only controls the command’s initial working directory: native commands are not sandboxed.
Sourcepub fn session_shell(self, shell: NativeShell) -> Self
pub fn session_shell(self, shell: NativeShell) -> Self
Selects the shell used by legacy and session commands, without login profiles.
Sourcepub fn with_sandbox(self, policy: SandboxPolicy) -> Result<Self, BoxError>
pub fn with_sandbox(self, policy: SandboxPolicy) -> Result<Self, BoxError>
Enforces an immutable OS sandbox for both legacy and session commands. Fails when the platform backend is missing; never retries unrestricted.
Sourcepub fn temp_dir(self, temp_dir: PathBuf) -> Self
pub fn temp_dir(self, temp_dir: PathBuf) -> Self
Overrides the temporary directory used for raw output files.
Sourcepub fn background_progress_interval(self, interval: Duration) -> Self
pub fn background_progress_interval(self, interval: Duration) -> Self
Sets how often background command progress is emitted.
Sourcepub fn auto_background_after(self, interval: Duration) -> Self
pub fn auto_background_after(self, interval: Duration) -> Self
Sets the foreground duration after which a command moves to background mode.
Trait Implementations§
Source§impl Executor for NativeRuntime
impl Executor for NativeRuntime
Source§fn capabilities(&self) -> ExecutorCapabilities
fn capabilities(&self) -> ExecutorCapabilities
Source§fn execute_session<'life0, 'async_trait>(
&'life0 self,
ctx: BaseCtx,
input: CommandArgs,
envs: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_session<'life0, 'async_trait>(
&'life0 self,
ctx: BaseCtx,
input: CommandArgs,
envs: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn interact_session<'life0, 'async_trait>(
&'life0 self,
ctx: BaseCtx,
input: SessionArgs,
) -> Pin<Box<dyn Future<Output = Result<SessionOutput, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn interact_session<'life0, 'async_trait>(
&'life0 self,
ctx: BaseCtx,
input: SessionArgs,
) -> Pin<Box<dyn Future<Output = Result<SessionOutput, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: BaseCtx,
input: ExecArgs,
envs: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<ExecOutput, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: BaseCtx,
input: ExecArgs,
envs: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<ExecOutput, BoxError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for NativeRuntime
impl !UnwindSafe for NativeRuntime
impl Freeze for NativeRuntime
impl Send for NativeRuntime
impl Sync for NativeRuntime
impl Unpin for NativeRuntime
impl UnsafeUnpin for NativeRuntime
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> 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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