pub struct RushingStats { /* private fields */ }Expand description
§RushingStats struct
A RushingStats represents aggregated rushing statistics
Implementations§
Source§impl RushingStats
impl RushingStats
Sourcepub fn new() -> RushingStats
pub fn new() -> RushingStats
Constructor for the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let my_stats = RushingStats::new();Sourcepub fn rushes(&self) -> u32
pub fn rushes(&self) -> u32
Get the number of rushes from the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let my_stats = RushingStats::new();
let rushes = my_stats.rushes();
assert!(rushes == 0);Sourcepub fn increment_rushes(&mut self)
pub fn increment_rushes(&mut self)
Increment the rushes in the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let mut my_stats = RushingStats::new();
my_stats.increment_rushes();
assert!(my_stats.rushes() == 1);Sourcepub fn fumbles(&self) -> u32
pub fn fumbles(&self) -> u32
Get the number of fumbles from the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let my_stats = RushingStats::new();
let fumbles = my_stats.fumbles();
assert!(fumbles == 0);Sourcepub fn increment_fumbles(&mut self)
pub fn increment_fumbles(&mut self)
Increment the fumbles in the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let mut my_stats = RushingStats::new();
my_stats.increment_fumbles();
assert!(my_stats.fumbles() == 1);Sourcepub fn touchdowns(&self) -> u32
pub fn touchdowns(&self) -> u32
Get the number of touchdowns in the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let my_stats = RushingStats::new();
let touchdowns = my_stats.touchdowns();
assert!(touchdowns == 0);Sourcepub fn increment_touchdowns(&mut self)
pub fn increment_touchdowns(&mut self)
Increment the touchdowns in the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let mut my_stats = RushingStats::new();
my_stats.increment_touchdowns();
assert!(my_stats.touchdowns() == 1);Sourcepub fn yards(&self) -> i32
pub fn yards(&self) -> i32
Get the rushing yards in the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let my_stats = RushingStats::new();
let yards = my_stats.yards();
assert!(yards == 0);Sourcepub fn increment_yards(&mut self, yards: i32)
pub fn increment_yards(&mut self, yards: i32)
Increment the rushing yards in the RushingStats struct
§Example
use fbsim_core::game::stat::RushingStats;
let mut my_stats = RushingStats::new();
my_stats.increment_yards(12);
assert!(my_stats.yards() == 12);Trait Implementations§
Source§impl Clone for RushingStats
impl Clone for RushingStats
Source§fn clone(&self) -> RushingStats
fn clone(&self) -> RushingStats
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 RushingStats
impl Debug for RushingStats
Source§impl Default for RushingStats
impl Default for RushingStats
Source§fn default() -> RushingStats
fn default() -> RushingStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RushingStats
impl<'de> Deserialize<'de> for RushingStats
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
Source§impl Display for RushingStats
impl Display for RushingStats
Source§impl Ord for RushingStats
impl Ord for RushingStats
Source§fn cmp(&self, other: &RushingStats) -> Ordering
fn cmp(&self, other: &RushingStats) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RushingStats
impl PartialEq for RushingStats
Source§impl PartialOrd for RushingStats
impl PartialOrd for RushingStats
Source§impl Serialize for RushingStats
impl Serialize for RushingStats
impl Eq for RushingStats
impl StructuralPartialEq for RushingStats
Auto Trait Implementations§
impl Freeze for RushingStats
impl RefUnwindSafe for RushingStats
impl Send for RushingStats
impl Sync for RushingStats
impl Unpin for RushingStats
impl UnwindSafe for RushingStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.