pub struct MeritBadgeProgress {
pub id: i64,
pub name: String,
pub date_started: Option<String>,
pub date_completed: Option<String>,
pub awarded_date: Option<String>,
pub percent_completed: Option<f32>,
pub is_eagle_required: Option<bool>,
pub status: Option<String>,
pub assigned_counselor: Option<CounselorInfo>,
pub requirements_completed: Option<i32>,
pub requirements_total: Option<i32>,
}Fields§
§id: i64§name: String§date_started: Option<String>§date_completed: Option<String>§awarded_date: Option<String>§percent_completed: Option<f32>§is_eagle_required: Option<bool>§status: Option<String>§assigned_counselor: Option<CounselorInfo>§requirements_completed: Option<i32>§requirements_total: Option<i32>Implementations§
Source§impl MeritBadgeProgress
impl MeritBadgeProgress
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
A merit badge is completed if status is “Awarded” or “Leader Approved”
pub fn is_awarded(&self) -> bool
pub fn progress_percent(&self) -> Option<i32>
Sourcepub fn summarize(badges: &[MeritBadgeProgress]) -> BadgeSummary
pub fn summarize(badges: &[MeritBadgeProgress]) -> BadgeSummary
Summarize a slice of badges into completed/in-progress/eagle counts.
Sourcepub fn cmp_by_progress(
a: &MeritBadgeProgress,
b: &MeritBadgeProgress,
) -> Ordering
pub fn cmp_by_progress( a: &MeritBadgeProgress, b: &MeritBadgeProgress, ) -> Ordering
Compare two badges for display sorting: in-progress first (by % desc), then completed/awarded (by date desc). Awarded items sort before merely completed within the completed group.
Sourcepub fn status_display(&self) -> (StatusCategory, String)
pub fn status_display(&self) -> (StatusCategory, String)
Classify the badge’s display status. Returns (category, display_text).
Sourcepub fn sort_date(&self) -> String
pub fn sort_date(&self) -> String
Sort date for ordering: prefers awarded_date, falls back to date_completed.
Sourcepub fn has_counselor(&self) -> bool
pub fn has_counselor(&self) -> bool
Check if this badge has an assigned counselor
Trait Implementations§
Source§impl Clone for MeritBadgeProgress
impl Clone for MeritBadgeProgress
Source§fn clone(&self) -> MeritBadgeProgress
fn clone(&self) -> MeritBadgeProgress
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 MeritBadgeProgress
impl Debug for MeritBadgeProgress
Source§impl<'de> Deserialize<'de> for MeritBadgeProgress
impl<'de> Deserialize<'de> for MeritBadgeProgress
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 MeritBadgeProgress
impl RefUnwindSafe for MeritBadgeProgress
impl Send for MeritBadgeProgress
impl Sync for MeritBadgeProgress
impl Unpin for MeritBadgeProgress
impl UnsafeUnpin for MeritBadgeProgress
impl UnwindSafe for MeritBadgeProgress
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