pub trait SesHandler:
Send
+ Sync
+ 'static {
// Required methods
fn handle_operation(
&self,
op: SesOperation,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Response<SesResponseBody>, SesError>> + Send>>;
fn handle_v2_operation(
&self,
method: Method,
path: String,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Response<SesResponseBody>, SesError>> + Send>>;
fn query_emails(
&self,
filter_id: Option<&str>,
filter_source: Option<&str>,
) -> String;
fn clear_emails(&self, filter_id: Option<&str>);
}Expand description
Trait that the SES business logic provider must implement.
The handler receives a parsed operation enum and the raw form body bytes. SES v1 receives form-urlencoded params (awsQuery protocol).
Required Methods§
Sourcefn handle_operation(
&self,
op: SesOperation,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Response<SesResponseBody>, SesError>> + Send>>
fn handle_operation( &self, op: SesOperation, body: Bytes, ) -> Pin<Box<dyn Future<Output = Result<Response<SesResponseBody>, SesError>> + Send>>
Handle an SES v1 operation and produce an HTTP response.
Sourcefn handle_v2_operation(
&self,
method: Method,
path: String,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Result<Response<SesResponseBody>, SesError>> + Send>>
fn handle_v2_operation( &self, method: Method, path: String, body: Bytes, ) -> Pin<Box<dyn Future<Output = Result<Response<SesResponseBody>, SesError>> + Send>>
Handle an SES v2 operation and produce an HTTP response.
Sourcefn query_emails(
&self,
filter_id: Option<&str>,
filter_source: Option<&str>,
) -> String
fn query_emails( &self, filter_id: Option<&str>, filter_source: Option<&str>, ) -> String
Query sent emails for the retrospection endpoint.
Returns a JSON string of { "messages": [...] }.
Sourcefn clear_emails(&self, filter_id: Option<&str>)
fn clear_emails(&self, filter_id: Option<&str>)
Clear sent emails for the retrospection endpoint.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".