pub struct LessonRun { /* private fields */ }Expand description
One lesson played in a sandbox of its own
Implementations§
Source§impl LessonRun
impl LessonRun
Sourcepub fn new(lesson: Lesson) -> Result<Self>
pub fn new(lesson: Lesson) -> Result<Self>
Start lesson from its first step, with its practice files held in
memory
Sourcepub fn with_world(
lesson: Lesson,
make: impl Fn(&Lesson) -> Result<VirtualFileSystem>,
) -> Result<Self>
pub fn with_world( lesson: Lesson, make: impl Fn(&Lesson) -> Result<VirtualFileSystem>, ) -> Result<Self>
Start lesson with practice files made by make (in memory, or on
disk for comparing the two)
pub fn lesson(&self) -> &Lesson
Sourcepub fn step(&self) -> &LessonStep
pub fn step(&self) -> &LessonStep
The current step (the last one once the lesson is finished)
Sourcepub fn step_index(&self) -> usize
pub fn step_index(&self) -> usize
0-based index of the current step
Sourcepub fn world(&self) -> &VirtualFileSystem
pub fn world(&self) -> &VirtualFileSystem
The practice files
Sourcepub fn display_cwd(&self) -> String
pub fn display_cwd(&self) -> String
The current folder as a prompt shows it: ~, ~/station
Auto Trait Implementations§
impl !Freeze for LessonRun
impl RefUnwindSafe for LessonRun
impl Send for LessonRun
impl Sync for LessonRun
impl Unpin for LessonRun
impl UnsafeUnpin for LessonRun
impl UnwindSafe for LessonRun
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