pub struct DynamicPool { /* private fields */ }Expand description
Dynamic pool where resources can be added/removed during execution.
Tracks both a global limit and per-tag slot counts. A task with a resource tag requires both a global slot AND a tag-specific slot.
Implementations§
Source§impl DynamicPool
impl DynamicPool
Trait Implementations§
Source§impl WorkerPool for DynamicPool
impl WorkerPool for DynamicPool
Source§fn acquire(&self, resource_tag: Option<&str>) -> bool
fn acquire(&self, resource_tag: Option<&str>) -> bool
Try to acquire a slot for a task. Returns true if available.
Source§fn add_resource(&self, tag: &str)
fn add_resource(&self, tag: &str)
Add a resource to the pool (for dynamic pools).
Source§fn remove_resource(&self, tag: &str)
fn remove_resource(&self, tag: &str)
Remove a resource from the pool (for dynamic pools).
Auto Trait Implementations§
impl !Freeze for DynamicPool
impl RefUnwindSafe for DynamicPool
impl Send for DynamicPool
impl Sync for DynamicPool
impl Unpin for DynamicPool
impl UnsafeUnpin for DynamicPool
impl UnwindSafe for DynamicPool
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