pub struct SiteLesson {
pub id: String,
pub title: String,
pub prompt: String,
pub code_template: Option<String>,
pub checks: Vec<String>,
pub packages: Vec<String>,
pub solution: Option<String>,
pub hints: Option<String>,
pub gotchas: Option<String>,
pub success_criteria: Option<String>,
}Expand description
One lesson as the in-browser runner consumes it: the Rust↔JS JSON contract (ADR-0008, §3.2).
Deliberately not the internal Lesson: it carries only what the runtime
needs and drops llm_evaluation_prompt (a server/CLI concern never shipped to
the client). A Rust-side change invisible to this shape is invisible to JS.
Fields§
§id: StringThe lesson’s course-scoped slug (its manifest id).
title: StringThe lesson’s human-readable title (its lesson_name).
prompt: StringWhat the learner is asked to do.
code_template: Option<String>Optional starter code for the editor.
checks: Vec<String>The check code-strings, run against a submission in the browser to grade it.
packages: Vec<String>Third-party packages the lesson’s code depends on. Always serialized as
an array — empty when the lesson declares none, never null or omitted
— so the JS runtime contract shape stays stable (ADR-0011, mirroring the
solution: null precedent from ADR-0008).
solution: Option<String>The author’s known-correct answer, for the runner to self-verify.
hints: Option<String>Optional learner-facing hints, rendered as an expandable <details> panel
in the browser. Always serialized (null when absent, never dropped via
skip_serializing_if) so the contract shape stays stable — mirroring the
solution: null precedent from ADR-0008.
gotchas: Option<String>Optional learner-facing gotchas (common pitfalls), rendered as an
expandable <details> panel in the browser. Always serialized (null
when absent, never dropped via skip_serializing_if) so the contract
shape stays stable — mirroring the solution: null and hints: null
precedents from ADR-0008.
success_criteria: Option<String>Optional author rubric, added to the in-browser LLM feedback prompt
between the task and the submission (ADR-0020). Always serialized (null
when absent) like solution, hints, and gotchas.
Trait Implementations§
Source§impl Clone for SiteLesson
impl Clone for SiteLesson
Source§fn clone(&self) -> SiteLesson
fn clone(&self) -> SiteLesson
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SiteLesson
impl Debug for SiteLesson
Source§impl PartialEq for SiteLesson
impl PartialEq for SiteLesson
Source§impl Serialize for SiteLesson
impl Serialize for SiteLesson
impl Eq for SiteLesson
impl StructuralPartialEq for SiteLesson
Auto Trait Implementations§
impl Freeze for SiteLesson
impl RefUnwindSafe for SiteLesson
impl Send for SiteLesson
impl Sync for SiteLesson
impl Unpin for SiteLesson
impl UnwindSafe for SiteLesson
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.