pub struct ControlDesc {
pub name: &'static str,
pub value_type: ControlValueType,
pub default: f64,
pub min: f64,
pub max: f64,
pub unit: &'static str,
pub doc: &'static str,
pub declared_when: DeclaredWhen,
}Expand description
Static, declarative description of one dynamic control’s capability. See
the module docs: this is the single source the imperative declaration
derives from and that describe controls reads, so they cannot drift.
Fields§
§name: &'static strCanonical control name — the key written via control_set, the TUI
e prompt, GET/POST /controls, and optimize.servo.
value_type: ControlValueTypeValue shape (drives the derived gauge + f64 conversion).
default: f64Documented default, projected to f64 (the baseline a run starts from when the field is unset; informational for discovery).
min: f64Inclusive lower bound the derived from_f64 validator enforces. For
ControlValueType::Rate this is treated as an exclusive floor (a
rate of 0 disables the limiter rather than servoing it).
max: f64Inclusive upper bound the derived from_f64 validator enforces.
unit: &'static strUnit label for describe (e.g. fibers, ops/sec, probability).
doc: &'static strOne-line description of what the knob does.
declared_when: DeclaredWhenWhen the control is actually declared on the component tree.
Implementations§
Source§impl ControlDesc
impl ControlDesc
Sourcepub fn build_u32(&self, initial: u32) -> Control<u32>
pub fn build_u32(&self, initial: u32) -> Control<u32>
Derive a u32 count control from this descriptor — name, [min, max]
range validator, and gauge projection all come from the descriptor —
seeded at initial. The caller attaches the instance-specific applier
(e.g. the fiber-pool resize) separately.
Sourcepub fn build_f64(&self, initial: f64) -> Control<f64>
pub fn build_f64(&self, initial: f64) -> Control<f64>
Derive an f64 fraction/frequency control from this descriptor.
Sourcepub fn build_rate(&self, initial_ops_per_sec: f64) -> Control<RateSpec>
pub fn build_rate(&self, initial_ops_per_sec: f64) -> Control<RateSpec>
Derive a RateSpec throughput control from this descriptor. min is an
exclusive floor: a non-positive value is rejected (a zero rate
disables the limiter, which is a phase-config decision, not a servo).
Trait Implementations§
Source§impl Clone for ControlDesc
impl Clone for ControlDesc
impl Copy for ControlDesc
Auto Trait Implementations§
impl Freeze for ControlDesc
impl RefUnwindSafe for ControlDesc
impl Send for ControlDesc
impl Sync for ControlDesc
impl Unpin for ControlDesc
impl UnsafeUnpin for ControlDesc
impl UnwindSafe for ControlDesc
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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