Skip to main content

ResourceMonitor

Trait ResourceMonitor 

Source
pub trait ResourceMonitor:
    Send
    + Sync
    + 'static {
    // Required method
    fn snapshot(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceUsage, SdkError>> + Send + '_>>;

    // Provided method
    fn is_over_budget(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<bool, SdkError>> + Send + '_>> { ... }
}
Expand description

Reports current resource usage and whether the budget is exceeded.

Required Methods§

Source

fn snapshot( &self, ) -> Pin<Box<dyn Future<Output = Result<ResourceUsage, SdkError>> + Send + '_>>

Snapshot the current usage.

Provided Methods§

Source

fn is_over_budget( &self, ) -> Pin<Box<dyn Future<Output = Result<bool, SdkError>> + Send + '_>>

Returns true if the current usage exceeds the configured budget.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§