pub struct GovernorConfig {
pub max_bytes: u64,
pub reserved_floor_bytes: u64,
pub class_budgets: [u64; 9],
pub thresholds: EscalationThresholds,
}Expand description
Node-level governor configuration.
Fields§
§max_bytes: u64Configured maximum bytes the node may reserve across all classes.
reserved_floor_bytes: u64Bytes of max_bytes only reserved classes (replication, network
buffers) may consume (S1E-003 step 5).
class_budgets: [u64; 9]Per-class budgets in MemoryClass::index order. Defaults to
max_bytes per class (bounded by the node total only).
thresholds: EscalationThresholdsEscalation thresholds.
Implementations§
Source§impl GovernorConfig
impl GovernorConfig
Sourcepub fn new(max_bytes: u64) -> Self
pub fn new(max_bytes: u64) -> Self
A config with the default reserved floor (max_bytes / 8), per-class
budgets bounded only by the node total, and default thresholds.
Sourcepub fn with_class_budget(self, class: MemoryClass, bytes: u64) -> Self
pub fn with_class_budget(self, class: MemoryClass, bytes: u64) -> Self
Overrides one class budget.
Sourcepub fn with_reserved_floor(self, bytes: u64) -> Self
pub fn with_reserved_floor(self, bytes: u64) -> Self
Overrides the reserved floor.
Sourcepub fn with_thresholds(self, thresholds: EscalationThresholds) -> Self
pub fn with_thresholds(self, thresholds: EscalationThresholds) -> Self
Overrides the escalation thresholds.
Sourcepub fn validate(&self) -> Result<(), MemoryError>
pub fn validate(&self) -> Result<(), MemoryError>
Checks the configuration invariants.
Trait Implementations§
Source§impl Clone for GovernorConfig
impl Clone for GovernorConfig
Source§fn clone(&self) -> GovernorConfig
fn clone(&self) -> GovernorConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GovernorConfig
impl Debug for GovernorConfig
Source§impl<'de> Deserialize<'de> for GovernorConfig
impl<'de> Deserialize<'de> for GovernorConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GovernorConfig
impl PartialEq for GovernorConfig
Source§impl Serialize for GovernorConfig
impl Serialize for GovernorConfig
impl StructuralPartialEq for GovernorConfig
Auto Trait Implementations§
impl Freeze for GovernorConfig
impl RefUnwindSafe for GovernorConfig
impl Send for GovernorConfig
impl Sync for GovernorConfig
impl Unpin for GovernorConfig
impl UnsafeUnpin for GovernorConfig
impl UnwindSafe for GovernorConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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