pub trait LoadSignal:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &str;
fn overload_threshold(&self) -> f32;
fn sample(&self, window: Duration) -> Vec<LoadSnapshot>;
// Provided methods
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CrawlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A source of recent system or client load observations.
Required Methods§
Sourcefn overload_threshold(&self) -> f32
fn overload_threshold(&self) -> f32
Returns the utilization threshold at which this signal is overloaded.
Sourcefn sample(&self, window: Duration) -> Vec<LoadSnapshot>
fn sample(&self, window: Duration) -> Vec<LoadSnapshot>
Returns observations from the requested recent window.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".