Skip to main content

App

Struct App 

Source
pub struct App {
Show 17 fields pub modules: Vec<ModuleFile>, pub selected_module: usize, pub current_view: ContentView, pub current_exercise: usize, pub input: String, pub cursor_pos: usize, pub last_output: Option<ExecutionResult>, pub submit_state: SubmitState, pub hints_revealed: usize, pub show_solution: bool, pub show_files: bool, pub show_help: bool, pub intro_scroll: u16, pub examples_scroll: u16, pub output_scroll: u16, pub progress: Progress, pub should_quit: bool,
}

Fields§

§modules: Vec<ModuleFile>§selected_module: usize§current_view: ContentView§current_exercise: usize§input: String§cursor_pos: usize§last_output: Option<ExecutionResult>§submit_state: SubmitState§hints_revealed: usize§show_solution: bool§show_files: bool§show_help: bool§intro_scroll: u16§examples_scroll: u16§output_scroll: u16§progress: Progress§should_quit: bool

Implementations§

Source§

impl App

Source

pub fn new(modules: Vec<ModuleFile>) -> Self

Source

pub fn current_module(&self) -> &ModuleFile

Source

pub fn current_exercise_opt(&self) -> Option<&Exercise>

Source

pub fn exercise_count(&self) -> usize

Source

pub fn module_progress(&self) -> Option<&ModuleProgress>

Source

pub fn exercise_is_completed(&self) -> bool

Source

pub fn input_push(&mut self, c: char)

Source

pub fn input_backspace(&mut self)

Source

pub fn input_delete(&mut self)

Source

pub fn cursor_left(&mut self)

Source

pub fn cursor_right(&mut self)

Source

pub fn cursor_home(&mut self)

Source

pub fn cursor_end(&mut self)

Source

pub fn clear_input(&mut self)

Source

pub fn select_prev_module(&mut self)

Source

pub fn select_next_module(&mut self)

Source

pub fn cycle_view(&mut self)

Source

pub fn next_exercise(&mut self)

Source

pub fn prev_exercise(&mut self)

Source

pub fn submit_command(&mut self)

Source

pub fn reveal_next_hint(&mut self)

Source

pub fn toggle_solution(&mut self)

Source

pub fn toggle_files(&mut self)

Source

pub fn toggle_help(&mut self)

Source

pub fn reset_exercise(&mut self)

Source

pub fn clear_output(&mut self)

Source

pub fn scroll_up(&mut self)

Source

pub fn scroll_down(&mut self)

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl UnwindSafe for App

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.