Skip to main content

ActionContract

Struct ActionContract 

Source
pub struct ActionContract {
    pub name: String,
    pub input_schema: Value,
    pub output_schema: Value,
    pub node: Option<String>,
    pub timeout: Option<Duration>,
    pub retry: Option<RetryContract>,
    pub advisory: bool,
    pub agent: bool,
    pub body: Option<ActionBodyContract>,
}
Expand description

One typed activity declaration.

Fields§

§name: String

Activity type.

§input_schema: Value

Object schema over the activity parameters.

§output_schema: Value

Activity result schema.

§node: Option<String>

Declared node selector.

§timeout: Option<Duration>

Declared schedule-to-close timeout.

§retry: Option<RetryContract>

Declaration-owned retry envelope.

§advisory: bool

Whether the declaration classes this activity as ADVISORY: a side channel whose failure warns on the run and never faults the calling step (RUNTIME-OPERATIONS.md R5). Identity-bound — flipping it changes what the package promises a caller.

§agent: bool

Whether the declaration classes this activity as an AGENT seam: its one String parameter carries a prompt and its String result carries the reply, so a worker hands the call to an agent harness rather than to a typed handler. The checker enforces that shape, so a worker reading this flag may rely on it.

Identity-bound for the same reason advisory is — an action that becomes an agent seam promises a caller something different — and skipped when false, so a document with no agent action hashes exactly as it did before the marker existed.

§body: Option<ActionBodyContract>

The declarative body the action carries, when it declares one.

None is a requirement on an out-of-band worker: the action’s name and schemas are the whole promise, and something must connect to serve it. Some means the package itself says what the action DOES, so the host can execute it with no worker connected.

Identity-bound deliberately: the body is executable authority, and an authority that did not participate in the package hash could be rewritten in storage without changing what the deployment claims to be. A body edit is a new package, always.

Implementations§

Source§

impl ActionContract

Source

pub fn worker_owed(&self) -> bool

Whether serving this action is a WORKER’s job.

true when the action carries no declared body: the declaration is a requirement on an out-of-band worker, and nothing runs until one connects and advertises the action. false when the action carries a declared body: the package itself says what the action does, the host executes it, and no worker is needed or admitted for it.

This is the one place the body-exemption rule lives. Every surface that splits a queue’s actions into worker-owed and server-run — admission diffs, availability, scaffolding, codegen — must call this rather than restate body.is_none().

Trait Implementations§

Source§

impl Clone for ActionContract

Source§

fn clone(&self) -> ActionContract

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionContract

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ActionContract

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ActionContract

Source§

impl PartialEq for ActionContract

Source§

fn eq(&self, other: &ActionContract) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ActionContract

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ActionContract

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.