pub struct WorkspacePool { /* private fields */ }Expand description
Workspace pool for managing multiple workspaces.
Implementations§
Source§impl WorkspacePool
impl WorkspacePool
Sourcepub fn new(config: WorkspaceConfig) -> Self
pub fn new(config: WorkspaceConfig) -> Self
Create a new workspace pool.
Sourcepub fn allocate(&mut self, size: usize) -> Result<String, WorkspaceError>
pub fn allocate(&mut self, size: usize) -> Result<String, WorkspaceError>
Allocate a workspace of at least the given size.
Sourcepub fn release(&mut self, id: &str) -> Result<(), WorkspaceError>
pub fn release(&mut self, id: &str) -> Result<(), WorkspaceError>
Release a workspace back to the pool.
Sourcepub fn stats(&self) -> &WorkspaceStats
pub fn stats(&self) -> &WorkspaceStats
Get statistics.
Sourcepub fn defragment(&mut self) -> DefragmentationResult
pub fn defragment(&mut self) -> DefragmentationResult
Perform defragmentation if needed.
Auto Trait Implementations§
impl Freeze for WorkspacePool
impl RefUnwindSafe for WorkspacePool
impl Send for WorkspacePool
impl Sync for WorkspacePool
impl Unpin for WorkspacePool
impl UnwindSafe for WorkspacePool
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