pub struct Runner { /* private fields */ }Expand description
Runs worker modes under the platform jail.
Implementations§
Source§impl Runner
impl Runner
Sourcepub fn new(
backend: Box<dyn JailBackend>,
worker: PathBuf,
limits: Limits,
) -> Runner
pub fn new( backend: Box<dyn JailBackend>, worker: PathBuf, limits: Limits, ) -> Runner
A runner over an explicit backend, worker, and limits.
Sourcepub fn with_platform_defaults() -> Result<Runner, RunnerError>
pub fn with_platform_defaults() -> Result<Runner, RunnerError>
The platform backend, the co-located worker binary, and default limits.
Sourcepub fn backend(&self) -> &dyn JailBackend
pub fn backend(&self) -> &dyn JailBackend
The backend this runner spawns through.
Sourcepub fn policy_digest(&self) -> Result<String, RunnerError>
pub fn policy_digest(&self) -> Result<String, RunnerError>
The policy digest that keys this runner’s probe cache entry.
Sourcepub fn run(
&self,
mode: &str,
payload: Value,
files: &[(&str, &[u8])],
) -> Result<Response, RunnerError>
pub fn run( &self, mode: &str, payload: Value, files: &[(&str, &[u8])], ) -> Result<Response, RunnerError>
Runs one adapter mode inside the jail and returns its response.
files are written into a fresh jail directory before the
spawn, so the child reads inputs by bare name from its working
directory. The capability probe must have passed for the
current policy digest, and runs once per process if not.
Auto Trait Implementations§
impl !RefUnwindSafe for Runner
impl !UnwindSafe for Runner
impl Freeze for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
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
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