Attribute Macro milter_callback::on_eom[][src]

#[on_eom]
Expand description

Generates a callback function of type EomCallback that delegates to the annotated function.

As its sole argument on_eom takes an identifier to be used as the name of the generated function.

The on_eom callback is called when the end of the message body is reached, that is the end of the SMTP DATA command. This is the only stage where message-modifying actions can be taken. The signature of the annotated function must be as specified below.

Arguments:

  • Context<T> – the callback context

Return type:

  • Status – the response status

Examples

use milter::{Context, Status};

#[on_eom(eom_callback)]
fn handle_eom(context: Context<MyData>) -> Status {
    Status::Continue
}