pub struct ResourceTracker { /* private fields */ }Expand description
Resource tracker for monitoring and enforcing limits
Implementations§
Source§impl ResourceTracker
impl ResourceTracker
pub fn new(permissions: Permissions) -> Self
pub fn track_memory_allocation(&self, bytes: usize) -> ToolResult<()>
pub fn track_memory_deallocation(&self, bytes: usize)
pub fn check_cpu_time(&self) -> ToolResult<()>
pub fn memory_usage(&self) -> usize
pub fn elapsed_time(&self) -> Duration
Auto Trait Implementations§
impl !Freeze for ResourceTracker
impl !RefUnwindSafe for ResourceTracker
impl Send for ResourceTracker
impl Sync for ResourceTracker
impl Unpin for ResourceTracker
impl !UnwindSafe for ResourceTracker
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