pub struct Award {
pub id: Option<i64>,
pub name: Option<String>,
pub date_started: Option<String>,
pub date_completed: Option<String>,
pub date_earned: Option<String>,
pub date_awarded: Option<String>,
pub award_type: Option<String>,
pub status: Option<String>,
pub awarded: Option<bool>,
pub percent_completed: Option<f32>,
pub leader_approved_date: Option<String>,
}Fields§
§id: Option<i64>§name: Option<String>§date_started: Option<String>§date_completed: Option<String>§date_earned: Option<String>§date_awarded: Option<String>§award_type: Option<String>§status: Option<String>§awarded: Option<bool>v2 API uses boolean awarded field
percent_completed: Option<f32>§leader_approved_date: Option<String>Implementations§
Source§impl Award
impl Award
Sourcepub fn sort_for_display(awards: &mut [Award])
pub fn sort_for_display(awards: &mut [Award])
Sort awards for display: awarded first, then by date_awarded desc.
Sourcepub fn is_awarded(&self) -> bool
pub fn is_awarded(&self) -> bool
Returns true if this award has been awarded (status is “Awarded”, awarded=true, or has awarded date)
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Returns true if this award is completed (status is “Awarded” or “Leader Approved”, or has leader approved date)
Sourcepub fn date_display(&self) -> String
pub fn date_display(&self) -> String
Format the date for display
Sourcepub fn type_display(&self) -> &str
pub fn type_display(&self) -> &str
Get the award type for display
Sourcepub fn progress_percent(&self) -> Option<i32>
pub fn progress_percent(&self) -> Option<i32>
Get progress percentage if available
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Award
impl<'de> Deserialize<'de> for Award
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 Award
impl RefUnwindSafe for Award
impl Send for Award
impl Sync for Award
impl Unpin for Award
impl UnsafeUnpin for Award
impl UnwindSafe for Award
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