pub struct LessonStep {
pub step_number: u32,
pub title: String,
pub instruction: String,
pub hint: Option<String>,
pub step_type: StepType,
pub hints: Vec<String>,
pub challenge: bool,
pub solution: Vec<String>,
}Expand description
A single step within a lesson
Fields§
§step_number: u32§title: String§instruction: String§hint: Option<String>Single hint (older lessons). Shown after the first miss.
step_type: StepType§hints: Vec<String>Hint ladder: one more rung is revealed after each wrong attempt. After the last rung the answer is shown (never on challenge steps).
challenge: boolA challenge step gives no hints and never reveals the answer.
solution: Vec<String>Commands that complete this step, in order. Not shown to learners; the test suite plays every built-in lesson with them. Needed for task steps; other steps fall back to their expected answer.
Implementations§
Source§impl LessonStep
impl LessonStep
Sourcepub fn hint_ladder(&self) -> Vec<&str>
pub fn hint_ladder(&self) -> Vec<&str>
The hint ladder for this step (falls back to the single hint)
Trait Implementations§
Source§impl Clone for LessonStep
impl Clone for LessonStep
Source§impl Debug for LessonStep
impl Debug for LessonStep
Source§impl<'de> Deserialize<'de> for LessonStep
impl<'de> Deserialize<'de> for LessonStep
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LessonStep
impl RefUnwindSafe for LessonStep
impl Send for LessonStep
impl Sync for LessonStep
impl Unpin for LessonStep
impl UnsafeUnpin for LessonStep
impl UnwindSafe for LessonStep
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more