pub struct SubprocessPool { /* private fields */ }
Implementations§
Source§impl SubprocessPool
impl SubprocessPool
Sourcepub async fn new(
builder: impl Fn() -> Command + Send + Sync + 'static,
max_size: usize,
) -> Result<Arc<Self>>
pub async fn new( builder: impl Fn() -> Command + Send + Sync + 'static, max_size: usize, ) -> Result<Arc<Self>>
Create a new pool with the given command and arguments.
The pool will start with max_size
processes.
Sourcepub async fn acquire(self: &Arc<Self>) -> Result<PooledProcess>
pub async fn acquire(self: &Arc<Self>) -> Result<PooledProcess>
Get a process from the pool for interactive use. Waits until a process becomes available if the pool is currently empty.
Auto Trait Implementations§
impl !Freeze for SubprocessPool
impl !RefUnwindSafe for SubprocessPool
impl Send for SubprocessPool
impl Sync for SubprocessPool
impl Unpin for SubprocessPool
impl !UnwindSafe for SubprocessPool
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