pub trait BodyExt<Mode: ModeExt, Step: StepExt>:
BodyConvert
+ TryFrom<Body>
+ Serialize
+ DeserializeOwned
+ Clone
+ Debug {
Show 17 methods
// Required methods
fn as_body(&self) -> Body;
fn is_complete(&self) -> bool;
fn kind() -> ModuleKind;
fn new_with_mode_and_theme(mode: Mode, theme_id: ThemeId) -> Self;
fn mode(&self) -> Option<Mode>;
fn requires_choose_mode(&self) -> bool;
fn get_theme(&self) -> Option<ThemeId>;
fn set_theme(&mut self, theme_id: ThemeId);
fn set_editor_state_step(&mut self, step: Step);
fn set_editor_state_steps_completed(
&mut self,
steps_completed: HashSet<Step>,
);
fn get_editor_state_step(&self) -> Option<Step>;
fn get_editor_state_steps_completed(&self) -> Option<HashSet<Step>>;
// Provided methods
fn choose_mode_list() -> Vec<Mode> { ... }
fn is_legacy() -> bool { ... }
fn has_preload() -> bool { ... }
fn insert_editor_state_step_completed(&mut self, step: Step) { ... }
fn convert_to_body(&self, kind: ModuleKind) -> Result<Body, &'static str> { ... }
}
Expand description
Extension trait for interop impl on inner body data
Required Methods§
Sourcefn is_complete(&self) -> bool
fn is_complete(&self) -> bool
is complete
Sourcefn kind() -> ModuleKind
fn kind() -> ModuleKind
get the kind from the type itself
Sourcefn new_with_mode_and_theme(mode: Mode, theme_id: ThemeId) -> Self
fn new_with_mode_and_theme(mode: Mode, theme_id: ThemeId) -> Self
given a Mode, get a new Self will usually populate an inner .content
Sourcefn requires_choose_mode(&self) -> bool
fn requires_choose_mode(&self) -> bool
requires an additional step of choosing the mode
Sourcefn set_editor_state_step(&mut self, step: Step)
fn set_editor_state_step(&mut self, step: Step)
Set editor state step
Sourcefn set_editor_state_steps_completed(&mut self, steps_completed: HashSet<Step>)
fn set_editor_state_steps_completed(&mut self, steps_completed: HashSet<Step>)
Set editor state steps completed
Sourcefn get_editor_state_step(&self) -> Option<Step>
fn get_editor_state_step(&self) -> Option<Step>
Get editor state step
Sourcefn get_editor_state_steps_completed(&self) -> Option<HashSet<Step>>
fn get_editor_state_steps_completed(&self) -> Option<HashSet<Step>>
Get editor state steps completed
Provided Methods§
Sourcefn choose_mode_list() -> Vec<Mode>
fn choose_mode_list() -> Vec<Mode>
get choose mode list. By default it’s the full list but that can be overridden to re-order or hide some modes
Sourcefn has_preload() -> bool
fn has_preload() -> bool
should wait for manual phase change to Init
Sourcefn insert_editor_state_step_completed(&mut self, step: Step)
fn insert_editor_state_step_completed(&mut self, step: Step)
Insert a completed step
Sourcefn convert_to_body(&self, kind: ModuleKind) -> Result<Body, &'static str>
fn convert_to_body(&self, kind: ModuleKind) -> Result<Body, &'static str>
Convert this inner data to a Body wrapper of a specific kind
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§
impl BodyExt<Mode, Step> for shared::domain::module::body::card_quiz::ModuleData
Module is a memory game, and has a memory game’s body.