shared::domain::module::body

Trait ModeExt

Source
pub trait ModeExt:
    Copy
    + Default
    + PartialEq
    + Eq
    + Hash {
    // Required methods
    fn get_list() -> Vec<Self>;
    fn as_str_id(&self) -> &'static str;
    fn label(&self) -> &'static str;

    // Provided methods
    fn image_tag_filters(&self) -> Option<Vec<i16>> { ... }
    fn image_tag_priorities(&self) -> Option<Vec<i16>> { ... }
}
Expand description

Extenstion trait for modes

Required Methods§

Source

fn get_list() -> Vec<Self>

get a list of all the modes (becomes the default in Choose page, which can be overriden in BodyExt)

Source

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

get the mode itself as a string id

Source

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

for headers, labels, etc.

Provided Methods§

Source

fn image_tag_filters(&self) -> Option<Vec<i16>>

Image tag filters for search The actual ImageTag enum variants are in components

Source

fn image_tag_priorities(&self) -> Option<Vec<i16>>

Image tag priorities for search The actual ImageTag enum variants are in components

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 ModeExt for ()

impl ModeExt for empty modes this is a special case and should only be used where the module genuinely ignores the mode one example is the Cover module

Source§

fn get_list() -> Vec<Self>

Source§

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

Source§

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

Implementors§

Source§

impl ModeExt for shared::domain::module::body::_groups::cards::Mode

Source§

impl ModeExt for shared::domain::module::body::drag_drop::Mode

Source§

impl ModeExt for shared::domain::module::body::embed::Mode

Source§

impl ModeExt for shared::domain::module::body::find_answer::Mode

Source§

impl ModeExt for shared::domain::module::body::poster::Mode

Source§

impl ModeExt for shared::domain::module::body::tapping_board::Mode

Source§

impl ModeExt for shared::domain::module::body::video::Mode