pub struct MandateObjectiveControl {
pub schema_version: u16,
pub metric_name: String,
pub unit: String,
pub baseline_micros: i64,
pub target_micros: i64,
pub direction: ObjectiveMetricDirection,
pub measurement_source: String,
pub measurement_cadence_secs: i64,
pub baseline_observed_at: String,
}Expand description
A measured objective: a number the mandate works to move to a target. Values use caller-declared micro-units to avoid floating-point drift.
New mandates no longer set one; it is kept, read-only, for a mandate that was confirmed with one, so its reviews still record and read the metric. Settings older rows also carry (experiment cohort and window, minimum effect, stagnation and failure budgets) are ignored.
Fields§
§schema_version: u16§metric_name: String§unit: String§baseline_micros: i64§target_micros: i64§direction: ObjectiveMetricDirection§measurement_source: StringExact analytics endpoint or stable metric-source resource identity.
measurement_cadence_secs: i64§baseline_observed_at: StringImplementations§
Source§impl MandateObjectiveControl
impl MandateObjectiveControl
pub const SCHEMA_VERSION: u16 = 1
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Checks every setting. An error names the one setting that is wrong.
pub fn target_reached(&self, value_micros: i64) -> bool
Sourcepub fn next_measurement_at(
&self,
latest_observed_at: Option<&str>,
) -> Option<String>
pub fn next_measurement_at( &self, latest_observed_at: Option<&str>, ) -> Option<String>
When the next measurement is due: one cadence after the latest
recorded observation, or one cadence after the baseline when nothing
has been measured yet. A value in the past means a measurement is due
now. Returns None only when neither timestamp parses.
Trait Implementations§
Source§impl Clone for MandateObjectiveControl
impl Clone for MandateObjectiveControl
Source§impl Debug for MandateObjectiveControl
impl Debug for MandateObjectiveControl
Source§impl<'de> Deserialize<'de> for MandateObjectiveControl
impl<'de> Deserialize<'de> for MandateObjectiveControl
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>,
impl Eq for MandateObjectiveControl
Source§impl PartialEq for MandateObjectiveControl
impl PartialEq for MandateObjectiveControl
Source§impl Serialize for MandateObjectiveControl
impl Serialize for MandateObjectiveControl
impl StructuralPartialEq for MandateObjectiveControl
Auto Trait Implementations§
impl Forget for MandateObjectiveControl
impl Freeze for MandateObjectiveControl
impl Move for MandateObjectiveControl
impl RefUnwindSafe for MandateObjectiveControl
impl Send for MandateObjectiveControlwhere
RawVecInner: Send,
impl Sync for MandateObjectiveControlwhere
RawVecInner: Sync,
impl Unpin for MandateObjectiveControl
impl UnsafeUnpin for MandateObjectiveControl
impl UnwindSafe for MandateObjectiveControlwhere
RawVecInner: UnwindSafe,
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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