pub struct Trigger {
pub id: String,
pub component: Option<ComponentSpec>,
pub components: IndexMap<String, OneOrManyComponentSpecs>,
pub dependencies: IndexMap<String, TriggerDependencies>,
pub config: Table,
}Expand description
Trigger configuration. A trigger maps an event of the trigger’s type (e.g.
an HTTP request on route /shop, a Redis message on channel orders) to
a Spin component.
The trigger manifest contains additional fields which depend on the trigger
type. For the http type, these additional fields are route (required) and
executor (optional). For the redis type, the additional fields are
channel (required) and address (optional). For other types, see the trigger
documentation.
Learn more: https://spinframework.dev/http-trigger, https://spinframework.dev/redis-trigger
Fields§
§id: StringOptional identifier for the trigger.
Example: id = "trigger-id"
component: Option<ComponentSpec>The component that Spin should run when the trigger occurs. For HTTP triggers,
this is the HTTP request handler for the trigger route. This is typically
the ID of an entry in the [component] table, although you can also write
the component out as the value of this field.
Example: component = "shop-handler"
Learn more: https://spinframework.dev/triggers#triggers-and-components
components: IndexMap<String, OneOrManyComponentSpecs>Additional components used when the trigger occurs. The meaning of entries in this table is trigger-specific.
components = { ... }
dependencies: IndexMap<String, TriggerDependencies>Additional components to be invoked during trigger processing. The meaning of entries in this table is trigger-specific.
dependencies = { ... }
config: TableOpaque trigger-type-specific config
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trigger
impl<'de> Deserialize<'de> for Trigger
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>,
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnsafeUnpin for Trigger
impl UnwindSafe for Trigger
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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