pub struct Script {
pub source: String,
pub dir: PathBuf,
pub timeout: Duration,
pub sandbox: SandboxMode,
}Expand description
A script Shell::run runs to its end.
Fields§
§source: StringThe script’s source, in the shell’s own interpreter.
dir: PathBufWhere it starts: a host path, which for a container shell lies in its workspace mount.
timeout: DurationThe bound after which the script and its process tree are killed.
sandbox: SandboxModeWhether it runs inside the sandbox; an unsandboxed script is put to the shell’s policies like any other.
Implementations§
Source§impl Script
impl Script
Sourcepub fn new(
source: impl Into<String>,
dir: impl Into<PathBuf>,
timeout: Duration,
) -> Self
pub fn new( source: impl Into<String>, dir: impl Into<PathBuf>, timeout: Duration, ) -> Self
source, started in dir and killed with its process tree once
timeout passes, in SandboxMode::Sandboxed.
Sourcepub const fn with_sandbox(self, sandbox: SandboxMode) -> Self
pub const fn with_sandbox(self, sandbox: SandboxMode) -> Self
The same script run in sandbox.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Script
impl Freeze for Script
impl Move for Script
impl RefUnwindSafe for Script
impl Send for Script
impl Sync for Script
impl Unpin for Script
impl UnsafeUnpin for Script
impl UnwindSafe for Script
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