shared::domain::module::body

Trait BodyConvert

Source
pub trait BodyConvert {
Show 14 methods // Provided methods fn convertable_list() -> Vec<ModuleKind> { ... } fn convert_to_memory(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_matching(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_flashcards(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_card_quiz(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_poster(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_tapping_board(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_drag_drop(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_cover(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_resource_cover(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_find_answer(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_video(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_embed(&self) -> Result<ModuleData, &'static str> { ... } fn convert_to_legacy(&self) -> Result<ModuleData, &'static str> { ... }
}
Expand description

These will all error by default. Modules that can be converted between eachother must override The relevant methods

Provided Methods§

Source

fn convertable_list() -> Vec<ModuleKind>

Get a list of valid conversion targets

Source

fn convert_to_memory(&self) -> Result<ModuleData, &'static str>

Memory game

Source

fn convert_to_matching(&self) -> Result<ModuleData, &'static str>

Matching

Source

fn convert_to_flashcards(&self) -> Result<ModuleData, &'static str>

Flashcards

Source

fn convert_to_card_quiz(&self) -> Result<ModuleData, &'static str>

Quiz game

Source

fn convert_to_poster(&self) -> Result<ModuleData, &'static str>

Talking Poster

Source

fn convert_to_tapping_board(&self) -> Result<ModuleData, &'static str>

Listen & Learn

Source

fn convert_to_drag_drop(&self) -> Result<ModuleData, &'static str>

Drag & Drop

Source

fn convert_to_cover(&self) -> Result<ModuleData, &'static str>

Cover

Source

fn convert_to_resource_cover(&self) -> Result<ModuleData, &'static str>

Resource Cover

Source

fn convert_to_find_answer(&self) -> Result<ModuleData, &'static str>

Resource Cover

Source

fn convert_to_video(&self) -> Result<ModuleData, &'static str>

Video

Source

fn convert_to_embed(&self) -> Result<ModuleData, &'static str>

Embed

Source

fn convert_to_legacy(&self) -> Result<ModuleData, &'static str>

Legacy

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§

Source§

impl BodyConvert for shared::domain::module::body::card_quiz::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::cover::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::drag_drop::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::embed::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::find_answer::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::flashcards::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::legacy::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::matching::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::memory::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::poster::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::resource_cover::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::tapping_board::ModuleData

Source§

impl BodyConvert for shared::domain::module::body::video::ModuleData