pub struct RankProgress {
pub rank_id: i64,
pub version_id: Option<i64>,
pub rank_name: String,
pub date_completed: Option<String>,
pub date_awarded: Option<String>,
pub requirements_completed: Option<i32>,
pub requirements_total: Option<i32>,
pub percent_completed: Option<f32>,
pub level: Option<i32>,
}Fields§
§rank_id: i64§version_id: Option<i64>§rank_name: String§date_completed: Option<String>§date_awarded: Option<String>§requirements_completed: Option<i32>§requirements_total: Option<i32>§percent_completed: Option<f32>§level: Option<i32>Implementations§
Source§impl RankProgress
impl RankProgress
Sourcepub fn sort_order(&self) -> i32
pub fn sort_order(&self) -> i32
Get sort order for rank (higher = more advanced, Eagle = 7, Scout = 1)
pub fn from_api(rank: &RankFromApi) -> Self
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
A rank is completed only if it has a non-empty dateEarned
pub fn is_awarded(&self) -> bool
pub fn progress_percent(&self) -> Option<i32>
Sourcepub fn sort_date(&self) -> String
pub fn sort_date(&self) -> String
Sort date for ordering: prefers date_awarded, falls back to date_completed.
Sourcepub fn display_date(&self) -> String
pub fn display_date(&self) -> String
Pre-computed display date for the status column.
Sourcepub fn status_display(&self) -> (StatusCategory, String)
pub fn status_display(&self) -> (StatusCategory, String)
Classify the rank’s display status. Returns (category, display_text).
Trait Implementations§
Source§impl Clone for RankProgress
impl Clone for RankProgress
Source§fn clone(&self) -> RankProgress
fn clone(&self) -> RankProgress
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 RankProgress
impl Debug for RankProgress
Source§impl<'de> Deserialize<'de> for RankProgress
impl<'de> Deserialize<'de> for RankProgress
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 RankProgress
impl RefUnwindSafe for RankProgress
impl Send for RankProgress
impl Sync for RankProgress
impl Unpin for RankProgress
impl UnsafeUnpin for RankProgress
impl UnwindSafe for RankProgress
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