pub trait RssSource: Send + Sync {
// Required method
fn read_rss_bytes(&self) -> u64;
// Provided method
fn total_ram_bytes(&self) -> u64 { ... }
}Expand description
Abstraction over “what is the current process RSS, in bytes”.
Implementations may cache their reading; the budget calls
RssSource::read_rss_bytes once per tick and is happy with a
best-effort value.
Required Methods§
Sourcefn read_rss_bytes(&self) -> u64
fn read_rss_bytes(&self) -> u64
Current process RSS in bytes.
Provided Methods§
Sourcefn total_ram_bytes(&self) -> u64
fn total_ram_bytes(&self) -> u64
Installed system RAM in bytes. Used at startup when auto-deriving the budget target. Implementations must return a positive value.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".