ToNext

Trait ToNext 

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

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

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

Required Methods§

Source

fn get_next(&self) -> Self

Gets the next variant.

Provided Methods§

Source

fn switch_to_next(&mut self)

Switches to the next 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§