on_data

Attribute Macro on_data 

Source
#[on_data]
Expand description

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

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

The on_data callback is called at the start of the message content (before header and body). 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_data(data_callback)]
fn handle_data(context: Context<MyData>) -> Status {
    Status::Continue
}