Ex

Derive Macro Ex 

Source
#[derive(Ex)]
{
    // Attributes available to this derive:
    #[derive_ex]
    #[ord]
    #[partial_ord]
    #[eq]
    #[partial_eq]
    #[hash]
    #[debug]
    #[default]
}
Expand description

Use attribute macro derive_ex as derive macro.

derive_ex, being an attribute macro designed to mimic the functionality of the derive macro, may cause rust-analyzer’s assistance to not work correctly in certain cases.

Adding #[derive(Ex)] to an item with #[derive_ex] will allow rust-analyzer’s assistance to work correctly.

In the example below, without #[derive(Ex)], the jump from value: String to the definition of String is not possible, but with #[derive(Ex)], it is possible.

use derive_ex::Ex;

#[derive(Ex)]
#[derive_ex(Eq, PartialEq)]
struct X {
    #[eq(key = $.len())]
    value: String,
}