#[non_exhaustive]pub struct InteractionDescriptor {Show 17 fields
pub interaction_id: InteractionId,
pub kind: InteractionKind,
pub http_method: InteractionHttpMethod,
pub label: String,
pub required_action: Option<String>,
pub input_schema: Option<SchemaContract>,
pub result_schema: Option<SchemaContract>,
pub sensitive_fields: Vec<String>,
pub params: Vec<ParamFieldDescriptor>,
pub timeout_seconds: Option<u16>,
pub confirmation: Option<InteractionConfirmation>,
pub transport: InteractionTransport,
pub workflow_steps: Vec<WorkflowStepDescriptor>,
pub form_ui: Option<FormUiDescriptor>,
pub icon: Option<String>,
pub submit_label: Option<String>,
pub provider_invocable: bool,
}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.interaction_id: InteractionId§kind: InteractionKind§http_method: InteractionHttpMethodHTTP method this interaction is dispatched with. Wire default is POST (providers that predate the method model omit the field); DataLoads normalize to GET at admission regardless of the declared value.
label: String§required_action: Option<String>Canonical action string (resource:verb) required to view/use this
interaction; parsed to Action at admission.
input_schema: Option<SchemaContract>§result_schema: Option<SchemaContract>§sensitive_fields: Vec<String>§params: Vec<ParamFieldDescriptor>Opt-in per-field param declarations (GET query typing + body validation).
timeout_seconds: Option<u16>§confirmation: Option<InteractionConfirmation>§transport: InteractionTransport§workflow_steps: Vec<WorkflowStepDescriptor>§form_ui: Option<FormUiDescriptor>§icon: Option<String>§submit_label: Option<String>§provider_invocable: boolAllows same-tenant provider-origin (service-initiated) invocation of
this interaction even when required_action is set. Fail-closed:
absent on the wire deserializes to false. Honored only for
Plugin/BuiltIn-registered interactions — see validate_for_provider.
For Service-kind providers the flag is additionally rejected at
surface-level admission when the home surface descriptor carries
required_action (enforced in protocol.rs’s registration
validation, not here).
Implementations§
Source§impl InteractionDescriptor
impl InteractionDescriptor
Sourcepub fn new(
interaction_id: InteractionId,
kind: InteractionKind,
label: impl Into<String>,
transport: InteractionTransport,
) -> InteractionDescriptor
pub fn new( interaction_id: InteractionId, kind: InteractionKind, label: impl Into<String>, transport: InteractionTransport, ) -> InteractionDescriptor
Creates a new InteractionDescriptor with all optional fields set to their defaults.
Sourcepub fn with_http_method(
self,
http_method: InteractionHttpMethod,
) -> InteractionDescriptor
pub fn with_http_method( self, http_method: InteractionHttpMethod, ) -> InteractionDescriptor
Declare a non-default dispatch method (PUT/DELETE mutations).
Sourcepub fn with_params(
self,
params: Vec<ParamFieldDescriptor>,
) -> InteractionDescriptor
pub fn with_params( self, params: Vec<ParamFieldDescriptor>, ) -> InteractionDescriptor
Declare per-field param descriptors (GET query typing + body validation).
Sourcepub fn effective_http_method(&self) -> InteractionHttpMethod
pub fn effective_http_method(&self) -> InteractionHttpMethod
The method the framework dispatches with: DataLoads are GET-only (B1); any other kind uses the declared method.
Sourcepub fn validate_for_provider(
&self,
provider_kind: ProviderKind,
) -> Result<(), InteractionValidationError>
pub fn validate_for_provider( &self, provider_kind: ProviderKind, ) -> Result<(), InteractionValidationError>
Validates provider-specific interaction contract rules.
§Errors
Returns InteractionValidationError::TimeoutOutOfRange when
timeout_seconds falls outside
MIN_INTERACTION_TIMEOUT_SECONDS..=MAX_INTERACTION_TIMEOUT_SECONDS.
Returns InteractionValidationError::WorkflowMissingSteps when
a workflow interaction declares no steps.
Returns
InteractionValidationError::ConfirmableActionMissingConfirmation
when a confirmable interaction omits confirmation metadata.
Returns InteractionValidationError::BlankLabel when label is
empty or whitespace-only.
Returns InteractionValidationError::BlankWorkflowStepLabel when
any workflow step has an empty or whitespace-only label.
Returns InteractionValidationError::IconInvalid when icon is
Some but fails kebab-case validation.
Returns
InteractionValidationError::ProviderInvocableForbiddenForServiceProviders
when a Service provider sets provider_invocable on an interaction
that also declares required_action. The descriptor-level companion
rule (rejecting provider_invocable when the surface descriptor
carries required_action) lives in
protocol.rs::validate_descriptor_gated_provider_invocable, because
this method never sees the surface descriptor.
Trait Implementations§
Source§impl Clone for InteractionDescriptor
impl Clone for InteractionDescriptor
Source§fn clone(&self) -> InteractionDescriptor
fn clone(&self) -> InteractionDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InteractionDescriptor
impl Debug for InteractionDescriptor
Source§impl<'de> Deserialize<'de> for InteractionDescriptor
impl<'de> Deserialize<'de> for InteractionDescriptor
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractionDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractionDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for InteractionDescriptor
Source§impl PartialEq for InteractionDescriptor
impl PartialEq for InteractionDescriptor
Source§impl Serialize for InteractionDescriptor
impl Serialize for InteractionDescriptor
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for InteractionDescriptor
Auto Trait Implementations§
impl Freeze for InteractionDescriptor
impl RefUnwindSafe for InteractionDescriptor
impl Send for InteractionDescriptor
impl Sync for InteractionDescriptor
impl Unpin for InteractionDescriptor
impl UnsafeUnpin for InteractionDescriptor
impl UnwindSafe for InteractionDescriptor
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.