[][src]Macro enum_derive_2018::PrevVariant

macro_rules! PrevVariant {
    (() $vis:vis enum $name:ident { $($body:tt)* }) => { ... };
    (
        @expand ($vis:vis) $name:ident ()
    ) => { ... };
    (
        @expand ($vis:vis) $name:ident ($($var_names:ident),*)
    ) => { ... };
    (
        @arms ($name:ident, $self_:expr), ($prev:expr, $a:ident) -> ($($body:tt)*)
    ) => { ... };
    (
        @arms ($name:ident, $self_:expr), ($prev:expr, $a:ident $($rest:tt)*) -> ($($body:tt)*)
    ) => { ... };
}

Derives prev_variant(&self) for an unitary enum, which returns the previous variant, or None when called for the first.