StepFunctionEvent

Trait StepFunctionEvent 

Source
pub trait StepFunctionEvent: Clone { }
Expand description

The StepFunctionEvent trait allows any deserializable struct to be used as the EventType for a LambdaContext.

§Example

use async_trait::async_trait;
use cobalt_aws::lambda::StepFunctionEvent;
use serde::{Deserialize, Serialize};

/// The structure of the event we expect to see at the Step Function.
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct MyEvent {
    pub greeting: String,
}

impl StepFunctionEvent for MyEvent {}

#[async_trait]
impl LambdaContext<Env, StatsEvent> for Context {
    ...
}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§