#[repr(C)]pub struct KernelDecision {Show 13 fields
pub request_sequence: u64,
pub action: KernelAction,
pub reason: KernelReason,
pub selected_model_id: u32,
pub selected_model_index: u16,
pub estimated_cost_microunits: u64,
pub expected_utility_microunits: i64,
pub counterfactual_model_id: u32,
pub counterfactual_utility_microunits: i64,
pub evaluated_models: u16,
pub eligible_models: u16,
pub policy_epoch: u64,
pub catalog_epoch: u64,
}Expand description
The result of evaluating a KernelInput against a PolicySnapshot.
Fields§
§request_sequence: u64Echoed from the input.
action: KernelActionWhat to do: execute, substitute, or reject.
reason: KernelReasonWhy this action was chosen.
selected_model_id: u32The model that was selected (0 if rejected).
selected_model_index: u16Index of the selected model in the catalog.
estimated_cost_microunits: u64Estimated cost of the selected model, in microunits.
expected_utility_microunits: i64Expected utility of the selected model.
counterfactual_model_id: u32The second-best model (for counterfactual analysis).
counterfactual_utility_microunits: i64Utility of the counterfactual model.
evaluated_models: u16How many models were evaluated.
eligible_models: u16How many models passed all constraints.
policy_epoch: u64Policy version used for this decision.
catalog_epoch: u64Catalog version used for this decision.
Implementations§
Source§impl KernelDecision
impl KernelDecision
Sourcepub const fn is_executable(&self) -> bool
pub const fn is_executable(&self) -> bool
Returns true when the decision selected a model that may be executed.
Sourcepub const fn is_requested_execution(&self) -> bool
pub const fn is_requested_execution(&self) -> bool
Returns true when the requested model was selected.
Sourcepub const fn is_substitution(&self) -> bool
pub const fn is_substitution(&self) -> bool
Returns true when a different eligible model was selected.
Sourcepub const fn is_rejected(&self) -> bool
pub const fn is_rejected(&self) -> bool
Returns true when the request failed closed and no model was selected.
Trait Implementations§
Source§impl Clone for KernelDecision
impl Clone for KernelDecision
Source§fn clone(&self) -> KernelDecision
fn clone(&self) -> KernelDecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for KernelDecision
Source§impl Debug for KernelDecision
impl Debug for KernelDecision
Source§impl<'de> Deserialize<'de> for KernelDecision
impl<'de> Deserialize<'de> for KernelDecision
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 KernelDecision
Source§impl PartialEq for KernelDecision
impl PartialEq for KernelDecision
Source§impl Serialize for KernelDecision
impl Serialize for KernelDecision
impl StructuralPartialEq for KernelDecision
Auto Trait Implementations§
impl Freeze for KernelDecision
impl RefUnwindSafe for KernelDecision
impl Send for KernelDecision
impl Sync for KernelDecision
impl Unpin for KernelDecision
impl UnsafeUnpin for KernelDecision
impl UnwindSafe for KernelDecision
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§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.