#[non_exhaustive]pub enum Body {
Show 13 variants
MemoryGame(ModuleData),
Matching(ModuleData),
Flashcards(ModuleData),
CardQuiz(ModuleData),
Poster(ModuleData),
Video(ModuleData),
Embed(ModuleData),
TappingBoard(ModuleData),
DragDrop(ModuleData),
Cover(ModuleData),
ResourceCover(ModuleData),
FindAnswer(ModuleData),
Legacy(ModuleData),
}
Expand description
Body kinds for Modules.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MemoryGame(ModuleData)
Module is a memory game, and has a memory game’s body.
Matching(ModuleData)
Module is matching game, and has a matching game’s body.
Flashcards(ModuleData)
Module is flashcards, and has a flashcard’s body.
CardQuiz(ModuleData)
Module is a quiz game, and has a quiz game’s body.
Poster(ModuleData)
Module is a poster, and has a talking poster’s body.
Video(ModuleData)
Module is a Video, and has a video body.
Embed(ModuleData)
Module is a Embed, and has a embed body.
TappingBoard(ModuleData)
Module is a Listen & Learn, and has a Listen & Learn’s body.
DragDrop(ModuleData)
Module is a drag & drop, and has a drag & drop’s body.
Cover(ModuleData)
Module is a Cover
.
Cover for Module type
ResourceCover(ModuleData)
Module is a Resource Cover.
FindAnswer(ModuleData)
Module is a Answer This (Find the Answer), and has Answer This’s (Find the Answer)’s body.
Legacy(ModuleData)
Module is a legacy, and has a legacy’s body.
Implementations§
Source§impl Body
impl Body
pub fn try_as_memory_game(self) -> Option<ModuleData>
pub const fn try_as_memory_game_ref(&self) -> Option<&ModuleData>
pub fn try_as_memory_game_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_matching(self) -> Option<ModuleData>
pub const fn try_as_matching_ref(&self) -> Option<&ModuleData>
pub fn try_as_matching_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_flashcards(self) -> Option<ModuleData>
pub const fn try_as_flashcards_ref(&self) -> Option<&ModuleData>
pub fn try_as_flashcards_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_card_quiz(self) -> Option<ModuleData>
pub const fn try_as_card_quiz_ref(&self) -> Option<&ModuleData>
pub fn try_as_card_quiz_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_poster(self) -> Option<ModuleData>
pub const fn try_as_poster_ref(&self) -> Option<&ModuleData>
pub fn try_as_poster_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_video(self) -> Option<ModuleData>
pub const fn try_as_video_ref(&self) -> Option<&ModuleData>
pub fn try_as_video_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_embed(self) -> Option<ModuleData>
pub const fn try_as_embed_ref(&self) -> Option<&ModuleData>
pub fn try_as_embed_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_tapping_board(self) -> Option<ModuleData>
pub const fn try_as_tapping_board_ref(&self) -> Option<&ModuleData>
pub fn try_as_tapping_board_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_drag_drop(self) -> Option<ModuleData>
pub const fn try_as_drag_drop_ref(&self) -> Option<&ModuleData>
pub fn try_as_drag_drop_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_cover(self) -> Option<ModuleData>
pub const fn try_as_cover_ref(&self) -> Option<&ModuleData>
pub fn try_as_cover_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_resource_cover(self) -> Option<ModuleData>
pub const fn try_as_resource_cover_ref(&self) -> Option<&ModuleData>
pub fn try_as_resource_cover_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_find_answer(self) -> Option<ModuleData>
pub const fn try_as_find_answer_ref(&self) -> Option<&ModuleData>
pub fn try_as_find_answer_mut(&mut self) -> Option<&mut ModuleData>
pub fn try_as_legacy(self) -> Option<ModuleData>
pub const fn try_as_legacy_ref(&self) -> Option<&ModuleData>
pub fn try_as_legacy_mut(&mut self) -> Option<&mut ModuleData>
Source§impl Body
impl Body
Sourcepub fn new(kind: ModuleKind) -> Self
pub fn new(kind: ModuleKind) -> Self
create a new Body for a given ModuleKind
Sourcepub fn convert_to_body(&self, kind: ModuleKind) -> Result<Self, &'static str>
pub fn convert_to_body(&self, kind: ModuleKind) -> Result<Self, &'static str>
Convert this container to a Body wrapper of a specific kind
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Helper to check whether the inner data is complete
Source§impl Body
impl Body
Sourcepub fn kind(&self) -> ModuleKind
pub fn kind(&self) -> ModuleKind
Gets this body’s related ModuleKind
Source§impl ModuleBody
impl ModuleBody
Sourcepub fn map_module_contents(body: &Self) -> Result<(ModuleKind, Value)>
pub fn map_module_contents(body: &Self) -> Result<(ModuleKind, Value)>
Maps module content from request body
Sourcepub fn transform_response_kind(
contents: Value,
kind: ModuleKind,
) -> Result<Self>
pub fn transform_response_kind( contents: Value, kind: ModuleKind, ) -> Result<Self>
Transforms module content from database