pub struct MultiStreamMemoryManager { /* private fields */ }Expand description
Multi-stream memory management for concurrent operations
Implementations§
Source§impl MultiStreamMemoryManager
impl MultiStreamMemoryManager
Sourcepub fn get_pool(&self, operation_id: usize) -> Result<&MemoryPool>
pub fn get_pool(&self, operation_id: usize) -> Result<&MemoryPool>
Get the appropriate memory pool for an operation
Sourcepub fn assign_operation_to_stream(
&self,
operation_id: usize,
stream_id: usize,
) -> Result<()>
pub fn assign_operation_to_stream( &self, operation_id: usize, stream_id: usize, ) -> Result<()>
Assign a specific operation to a specific stream
Sourcepub fn unassign_operation(&self, operation_id: usize)
pub fn unassign_operation(&self, operation_id: usize)
Remove an operation’s stream assignment
Sourcepub fn get_operation_stream(&self, operation_id: usize) -> Option<usize>
pub fn get_operation_stream(&self, operation_id: usize) -> Option<usize>
Get the stream ID for a specific operation
Sourcepub fn num_streams(&self) -> usize
pub fn num_streams(&self) -> usize
Get the number of available streams
Sourcepub fn get_pool_by_stream(&self, stream_id: usize) -> Result<&MemoryPool>
pub fn get_pool_by_stream(&self, stream_id: usize) -> Result<&MemoryPool>
Get a specific pool by stream ID
Sourcepub fn stats(&self) -> Vec<MemoryPoolStats>
pub fn stats(&self) -> Vec<MemoryPoolStats>
Get statistics for all streams
Sourcepub fn stream_stats(&self, stream_id: usize) -> Result<MemoryPoolStats>
pub fn stream_stats(&self, stream_id: usize) -> Result<MemoryPoolStats>
Get statistics for a specific stream
Sourcepub fn total_memory_usage(&self) -> (usize, usize)
pub fn total_memory_usage(&self) -> (usize, usize)
Get total memory usage across all streams
Sourcepub fn get_least_loaded_stream(&self) -> usize
pub fn get_least_loaded_stream(&self) -> usize
Get the least loaded stream (for load balancing)
Sourcepub fn get_stream_with_most_free_memory(&self) -> usize
pub fn get_stream_with_most_free_memory(&self) -> usize
Get the stream with the most free memory
Sourcepub fn balance_streams(&self) -> Result<usize>
pub fn balance_streams(&self) -> Result<usize>
Balance memory across streams by reassigning operations
Sourcepub fn generate_streams_report(&self) -> String
pub fn generate_streams_report(&self) -> String
Generate a comprehensive report of all streams
Sourcepub fn clear_assignments(&self)
pub fn clear_assignments(&self)
Clear all operation assignments
Sourcepub fn get_operation_counts(&self) -> Vec<usize>
pub fn get_operation_counts(&self) -> Vec<usize>
Get operation count per stream
Sourcepub fn are_streams_balanced(&self, tolerance_percent: f32) -> bool
pub fn are_streams_balanced(&self, tolerance_percent: f32) -> bool
Check if streams are balanced (within tolerance)
Auto Trait Implementations§
impl Freeze for MultiStreamMemoryManager
impl RefUnwindSafe for MultiStreamMemoryManager
impl Send for MultiStreamMemoryManager
impl Sync for MultiStreamMemoryManager
impl Unpin for MultiStreamMemoryManager
impl UnsafeUnpin for MultiStreamMemoryManager
impl UnwindSafe for MultiStreamMemoryManager
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