pub struct LessonProgress {
pub lesson_id: String,
pub current_step: u32,
pub completed_steps: Vec<u32>,
pub started_at: DateTime<Utc>,
pub completed_at: Option<DateTime<Utc>>,
pub attempts: HashMap<u32, u32>,
}Expand description
Progress tracking for a user through lessons
Fields§
§lesson_id: String§current_step: u32§completed_steps: Vec<u32>§started_at: DateTime<Utc>§completed_at: Option<DateTime<Utc>>§attempts: HashMap<u32, u32>Implementations§
Source§impl LessonProgress
impl LessonProgress
pub fn new(lesson_id: String) -> Self
pub fn is_completed(&self) -> bool
pub fn completion_percentage(&self, total_steps: u32) -> f32
pub fn record_attempt(&mut self, step_number: u32)
pub fn complete_step(&mut self, step_number: u32)
pub fn complete_lesson(&mut self)
Trait Implementations§
Source§impl Clone for LessonProgress
impl Clone for LessonProgress
Source§fn clone(&self) -> LessonProgress
fn clone(&self) -> LessonProgress
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LessonProgress
impl Debug for LessonProgress
Source§impl<'de> Deserialize<'de> for LessonProgress
impl<'de> Deserialize<'de> for LessonProgress
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 LessonProgress
impl RefUnwindSafe for LessonProgress
impl Send for LessonProgress
impl Sync for LessonProgress
impl Unpin for LessonProgress
impl UnwindSafe for LessonProgress
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