#[non_exhaustive]pub struct SignalLabels {
pub workflow: Option<WorkflowKey>,
pub provider: Option<ProviderKey>,
pub risk: Option<RiskClass>,
pub model: Option<ModelKey>,
pub purpose: Option<String>,
pub interaction: Option<InteractionKind>,
pub error_code: Option<String>,
pub operation: Option<OperationKey>,
pub effort: Option<Effort>,
}Expand description
Structured, text-free labels attached to a signal.
Every field is an identifier or an enumeration with a bounded value set. Observers may drop labels a signal does not document; they must never add free text.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workflow: Option<WorkflowKey>Workflow the signal concerns.
provider: Option<ProviderKey>Provider key, for provider signals.
risk: Option<RiskClass>Risk class, for command signals.
model: Option<ModelKey>Model key, for provider signals. Configured model identifiers only.
purpose: Option<String>Normalized request purpose (e.g. "extract"), for provider
signals (spec §20.2).
interaction: Option<InteractionKind>Interaction kind, for interaction signals.
error_code: Option<String>Stable machine-readable code that qualifies a failure or rejection
(a RejectionCode, a provider failure
code, an invariant kind…). Never a message.
operation: Option<OperationKey>Operation an act names, for signals about one act rather than one turn.
Bounded like Self::workflow is, because the set of operations is the
catalog and the catalog is finite. Never an argument or a value.
effort: Option<Effort>The effort of the turn the signal belongs to.
Implementations§
Source§impl SignalLabels
impl SignalLabels
Sourcepub fn workflow(workflow: WorkflowKey) -> Self
pub fn workflow(workflow: WorkflowKey) -> Self
Labels with a workflow.
Sourcepub fn with_provider(self, provider: impl Into<ProviderKey>) -> Self
pub fn with_provider(self, provider: impl Into<ProviderKey>) -> Self
Adds a provider key.
Sourcepub fn with_model(self, model: impl Into<ModelKey>) -> Self
pub fn with_model(self, model: impl Into<ModelKey>) -> Self
Adds a model key.
Sourcepub fn with_purpose(self, purpose: impl Into<String>) -> Self
pub fn with_purpose(self, purpose: impl Into<String>) -> Self
Adds a normalized request purpose.
Sourcepub fn with_effort(self, effort: Effort) -> Self
pub fn with_effort(self, effort: Effort) -> Self
Labels the signal with the turn’s effort.
Sourcepub fn with_interaction(self, kind: InteractionKind) -> Self
pub fn with_interaction(self, kind: InteractionKind) -> Self
Adds an interaction kind.
Sourcepub fn with_operation(self, operation: impl Into<OperationKey>) -> Self
pub fn with_operation(self, operation: impl Into<OperationKey>) -> Self
Adds a stable error or rejection code.
Sourcepub fn with_error_code(self, code: impl Into<String>) -> Self
pub fn with_error_code(self, code: impl Into<String>) -> Self
Returns a copy carrying a failure or rejection code.
Trait Implementations§
Source§impl Clone for SignalLabels
impl Clone for SignalLabels
Source§impl Debug for SignalLabels
impl Debug for SignalLabels
Source§impl Default for SignalLabels
impl Default for SignalLabels
impl Eq for SignalLabels
Source§impl PartialEq for SignalLabels
impl PartialEq for SignalLabels
impl StructuralPartialEq for SignalLabels
Auto Trait Implementations§
impl Freeze for SignalLabels
impl RefUnwindSafe for SignalLabels
impl Send for SignalLabels
impl Sync for SignalLabels
impl Unpin for SignalLabels
impl UnsafeUnpin for SignalLabels
impl UnwindSafe for SignalLabels
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<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.