Skip to main content

SopTrigger

Enum SopTrigger 

pub enum SopTrigger {
    Mqtt {
        topic: String,
        condition: Option<String>,
    },
    Webhook {
        path: String,
    },
    Cron {
        expression: String,
    },
    Peripheral {
        board: String,
        signal: String,
        condition: Option<String>,
    },
    Filesystem {
        path: String,
        events: Vec<FilesystemEventKind>,
        condition: Option<String>,
    },
    Calendar {
        calendar_source: String,
        calendar_ids: Vec<String>,
        condition: Option<String>,
    },
    Channel {
        channel: String,
        alias: Option<String>,
        condition: Option<String>,
    },
    Manual,
    Amqp {
        routing_key: String,
        condition: Option<String>,
    },
}
Expand description

What event can activate an SOP.

Variants§

§

Mqtt

MQTT message arrival. Live: delivered by the MQTT listener.

Fields

§topic: String

Topic filter. + matches one level, # matches the remaining levels.

§condition: Option<String>

Optional expression evaluated against the message payload; the run starts only when it holds.

§

Webhook

Inbound HTTP request. Live: gateway /sop/* and SOP-first /webhook routes.

Fields

§path: String

Request path matched exactly against the event path.

§

Cron

Time-based firing. Live: dispatched by the SOP maintenance tick (daemon / channel-start paths).

Fields

§expression: String

Cron expression evaluated over the run window.

§

Peripheral

Hardware signal. Defined and matched, but no peripheral listener feeds it.

Fields

§board: String

Board identifier the signal originates from.

§signal: String

Signal name on the board; matched as board/signal.

§condition: Option<String>

Optional expression evaluated against the signal payload.

§

Filesystem

Filesystem change. Live: delivered by the filesystem watcher.

Fields

§path: String

Path glob (*, **, ?); a bare directory matches anything under it.

§events: Vec<FilesystemEventKind>

Change kinds to match; empty matches every kind.

§condition: Option<String>

Optional expression evaluated against the change payload.

§

Calendar

Calendar event state. Defined and matched, but no poller feeds it live.

Fields

§calendar_source: String

Calendar source identifier the event originates from.

§calendar_ids: Vec<String>

Calendar IDs to scope to; empty matches all of the source’s calendars.

§condition: Option<String>

Optional expression evaluated against the calendar event payload.

§

Channel

Inbound message or forge/platform event on a configured channel (telegram, discord, slack, git, …). Live: delivered by the channel orchestrator when the channel’s SOP dispatch is enabled. The Git forge producer sets an event topic of the form <channel>.<alias>:<event_type> and puts event_type in the payload, so an authored condition filters forge events by type without a second trigger shape.

Fields

§channel: String

ChannelKind snake_case value naming the channel type.

§alias: Option<String>

Optional configured-instance alias; unset matches every instance.

§condition: Option<String>

Optional expression evaluated against the message payload.

§

Manual

Agent-initiated run via the sop_execute tool. Not an external fan-in.

§

Amqp

AMQP delivery. Live: delivered by the AMQP consumer in a SOP dispatch mode.

Fields

§routing_key: String

Routing-key filter (topic-exchange semantics): .-delimited words, * matches one word, # matches zero or more words.

§condition: Option<String>

Optional expression evaluated against the delivery body.

Implementations§

Source§

impl SopTrigger

Source

pub fn source(&self) -> SopTriggerSource

Source

pub fn is_headless(&self) -> bool

True when this trigger can only start a run with no ambient agent turn.

Every fan-in source except Manual fires from a listener, poller, or the maintenance tick, none of which carry an agent identity a step could borrow, so a procedure reachable by one must declare its own owning agent (see Sop::agent).

Manual is false because it is reachable from both sides: through the sop_execute tool the calling turn’s agent owns the run, while the dashboard run endpoint emits the same event from outside any agent turn. The trigger alone cannot tell those apart, so ownership for a Manual start is enforced by the surface that starts it (sop::headless_ownership_refusal) rather than by this flag.

Trait Implementations§

Source§

impl Clone for SopTrigger

Source§

fn clone(&self) -> SopTrigger

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SopTrigger

Source§

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

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

impl<'de> Deserialize<'de> for SopTrigger

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 Display for SopTrigger

Source§

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

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

impl Eq for SopTrigger

Source§

impl<'_enum> From<&'_enum SopTrigger> for SopTriggerSource

Source§

fn from(val: &'_enum SopTrigger) -> SopTriggerSource

Converts to this type from the input type.
Source§

impl From<SopTrigger> for SopTriggerSource

Source§

fn from(val: SopTrigger) -> SopTriggerSource

Converts to this type from the input type.
Source§

impl IntoDiscriminant for SopTrigger

Source§

type Discriminant = SopTriggerSource

Enum listing the same variants as this enum but without any data fields
Source§

fn discriminant(&self) -> Self::Discriminant

Source§

impl JsonSchema for SopTrigger

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for SopTrigger

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for SopTrigger

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 SopTrigger

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

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

§

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<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

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

§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more