Macro key_path

Source
macro_rules! key_path {
    (
        @go:
        $path:expr,
        [],
    ) => { ... };
    (
        @go:
        $path:expr,
        [ . $field:ident $($tt:tt)*],
    ) => { ... };
    (
        @go:
        $path:expr,
        [ . $field:literal $($tt:tt)*],
    ) => { ... };
    (
        @go:
        $path:expr,
        [ [$field:expr] $($tt:tt)*],
    ) => { ... };
    (
        @go:
        $path:expr,
        [ :: $variant:ident $($tt:tt)*],
    ) => { ... };
    (
        @go:
        $path:expr,
        [$($tt:tt)*],
    ) => { ... };
    ( $($tt:tt)* ) => { ... };
}
Expand description

Convenience macro for creating KeyPaths.

Expands to calls to field, get, variant, and methods on KeyPath.