on_unknown

Attribute Macro on_unknown 

Source
#[on_unknown]
Expand description

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

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

The on_unknown callback is called for unknown SMTP commands. The signature of the annotated function must be as specified below.

Arguments:

  • Context<T> โ€“ the callback context
  • &str โ€“ the SMTP command

Return type:

  • Status โ€“ the response status

ยงExamples

use milter::{Context, Status};

#[on_unknown(unknown_callback)]
fn handle_unknown(context: Context<MyData>, smtp_cmd: &str) -> Status {
    Status::Continue
}