shared::domain::module::body

Trait StepExt

Source
pub trait StepExt:
    Clone
    + Copy
    + Default
    + PartialEq
    + Eq
    + Hash
    + Debug
    + Unpin {
    // Required methods
    fn next(&self) -> Option<Self>;
    fn as_number(&self) -> usize;
    fn label(&self) -> &'static str;
    fn get_list() -> Vec<Self>;
    fn get_preview() -> Self;

    // Provided method
    fn is_preview(&self) -> bool { ... }
}
Expand description

This extension trait makes it possible to keep the Step functionality generic and at a higher level than the module itself

Required Methods§

Source

fn next(&self) -> Option<Self>

Get the next step from current step

Source

fn as_number(&self) -> usize

Get the step as a number

Source

fn label(&self) -> &'static str

Label to display (will be localized)

Source

fn get_list() -> Vec<Self>

List of all available steps

Source

fn get_preview() -> Self

Get the step which is synonymous with “preview” TODO: this could probably be derived as a combo of get_list() and next() (i.e. the first step to return None)

Provided Methods§

Source

fn is_preview(&self) -> bool

Auto-implemented, check whether current step is “preview”

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.

Implementations on Foreign Types§

Source§

impl StepExt for ()

impl StepExt for empty steps this is a special case and should only be used where the module genuinely ignores the step one example is the Legacy module

Source§

fn next(&self) -> Option<Self>

Source§

fn as_number(&self) -> usize

Source§

fn label(&self) -> &'static str

Source§

fn get_list() -> Vec<Self>

Source§

fn get_preview() -> Self

Implementors§

Source§

impl StepExt for shared::domain::module::body::_groups::cards::Step

Source§

impl StepExt for shared::domain::module::body::cover::Step

Source§

impl StepExt for shared::domain::module::body::drag_drop::Step

Source§

impl StepExt for shared::domain::module::body::embed::Step

Source§

impl StepExt for shared::domain::module::body::find_answer::Step

Source§

impl StepExt for shared::domain::module::body::poster::Step

Source§

impl StepExt for shared::domain::module::body::resource_cover::Step

Source§

impl StepExt for shared::domain::module::body::tapping_board::Step

Source§

impl StepExt for shared::domain::module::body::video::Step