pub struct Session { /* private fields */ }Expand description
A session for concurrent sandbox execution.
Session wraps the low-level Executor with a more ergonomic API.
Implementations§
Source§impl Session
impl Session
Sourcepub fn poll(&mut self) -> Result<Vec<Event>>
pub fn poll(&mut self) -> Result<Vec<Event>>
Poll for events, returning immediately if none are available.
Sourcepub fn poll_blocking(&mut self, timeout: Option<Duration>) -> Result<Vec<Event>>
pub fn poll_blocking(&mut self, timeout: Option<Duration>) -> Result<Vec<Event>>
Poll for events, blocking until at least one is available or timeout expires.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get the number of active (running) sandboxes.
Sourcepub fn write_stdin(&mut self, id: SandboxId, data: &[u8]) -> Result<usize>
pub fn write_stdin(&mut self, id: SandboxId, data: &[u8]) -> Result<usize>
Write data to a sandbox’s stdin.
Sourcepub fn close_stdin(&mut self, id: SandboxId) -> Result<()>
pub fn close_stdin(&mut self, id: SandboxId) -> Result<()>
Close a sandbox’s stdin (signal EOF).
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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