pub struct ResourceManager { /* private fields */ }Expand description
Resource manager for parallel operations
Implementations§
Source§impl ResourceManager
impl ResourceManager
Sourcepub fn try_allocate(&self, bytes: usize) -> Result<bool>
pub fn try_allocate(&self, bytes: usize) -> Result<bool>
Try to allocate memory
Sourcepub fn current_usage_mb(&self) -> Result<f64>
pub fn current_usage_mb(&self) -> Result<f64>
Get current memory usage in MB
Sourcepub fn max_memory_mb(&self) -> Result<f64>
pub fn max_memory_mb(&self) -> Result<f64>
Get max memory in MB
Sourcepub fn max_threads(&self) -> usize
pub fn max_threads(&self) -> usize
Get max threads
Sourcepub fn acquire_thread(&self) -> bool
pub fn acquire_thread(&self) -> bool
Acquire a thread slot
Sourcepub fn release_thread(&self)
pub fn release_thread(&self)
Release a thread slot
Sourcepub fn active_threads(&self) -> usize
pub fn active_threads(&self) -> usize
Get active thread count
Auto Trait Implementations§
impl Freeze for ResourceManager
impl RefUnwindSafe for ResourceManager
impl Send for ResourceManager
impl Sync for ResourceManager
impl Unpin for ResourceManager
impl UnsafeUnpin for ResourceManager
impl UnwindSafe for ResourceManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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