pub struct Exercise {
pub id: &'static str,
pub kind: ExerciseKind,
pub concepts: &'static [&'static str],
pub prompt: &'static str,
pub mode: ExampleMode,
pub expected: &'static str,
pub starter: &'static str,
pub hints: &'static [&'static str],
pub reference: &'static str,
}Expand description
A “now you try” challenge: the reader writes code (Imperative — graded by
exact program output), a page (Web — graded by its own ## Test blocks)
or FOL (Logic — graded structurally by the Learn grader), right in the guide.
Fields§
§id: &'static str§kind: ExerciseKindWhere this sits on the fading ladder.
concepts: &'static [&'static str]The LANGUAGE_SURFACE features this practices (deliberate practice targets the hard part; checkpoints interleave via these).
prompt: &'static strThe task, stated to the reader.
mode: ExampleMode§expected: &'static strThe graded target: exact output lines (Imperative) or the expected FOL. Empty for a Web
exercise, which is graded by the ## Test blocks its page carries.
starter: &'static strPre-filled editor contents.
hints: &'static [&'static str]1–3 progressive hints, disclosed on demand: orient, then narrow — never the answer (Bloom’s corrective tutor).
reference: &'static strThe hidden answer key — the self-check lock proves it grades correct.
Trait Implementations§
impl StructuralPartialEq for Exercise
Auto Trait Implementations§
impl Freeze for Exercise
impl RefUnwindSafe for Exercise
impl Send for Exercise
impl Sync for Exercise
impl Unpin for Exercise
impl UnsafeUnpin for Exercise
impl UnwindSafe for Exercise
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.