ToPrev

Trait ToPrev 

Source
pub trait ToPrev: Sized {
    // Required method
    fn get_prev(&self) -> Self;

    // Provided method
    fn switch_to_prev(&mut self) { ... }
}
Expand description

Trait for enums that can get the previous variant in a circular manner.

Required Methods§

Source

fn get_prev(&self) -> Self

Gets the previous variant.

Provided Methods§

Source

fn switch_to_prev(&mut self)

Switches to the previous variant.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§