#[repr(u8)]pub enum ClinchKind {
Bye = 4,
Divisional = 3,
WildCard = 2,
Postseason = 1,
None = 0,
}Expand description
Different indicators for clinching the playoffs.
Note: This assumes the modern postseason format, if you are dealing with older formats the predicates below are not guaranteed to work.
Variants§
Bye = 4
The Team has clinched a top seed guaranteeing a bye.
Divisional = 3
The team has clinched their position in the division.
WildCard = 2
The team has clinched a wild card position.
Postseason = 1
The team has clinched a position in the postseason, however that specific placement is unknown.
None = 0
Team has not clinched the postseason.
Implementations§
Source§impl ClinchKind
impl ClinchKind
Sourcepub const fn clinched_postseason(self) -> bool
pub const fn clinched_postseason(self) -> bool
Whether a team is guaranteed to play in the postseason.
§Examples
use mlb_api::standings::ClinchKind;
assert!( ClinchKind::Bye.clinched_postseason());
assert!( ClinchKind::WildCard.clinched_postseason());
assert!( ClinchKind::Postseason.clinched_postseason());
assert!(! ClinchKind::None.clinched_postseason());Sourcepub const fn is_final(self) -> bool
pub const fn is_final(self) -> bool
Whether the ClinchKind is a final decision and cannot be changed.
§Examples
use mlb_api::standings::ClinchKind;
assert!( ClinchKind::Bye.is_final());
assert!( ClinchKind::WildCard.is_final());
assert!(! ClinchKind::Postseason.is_final());
assert!(! ClinchKind::None.is_final());Sourcepub const fn guaranteed_in_wildcard(self) -> bool
pub const fn guaranteed_in_wildcard(self) -> bool
Whether the team will play in a Wild Card Series.
If the postseason decision is not final, the team is considered to not play in the wild card round. If you want different behavior use Self::guaranteed_in_wildcard.
§Examples
use mlb_api::standings::ClinchKind;
assert!(! ClinchKind::Bye.guaranteed_in_wildcard());
assert!( ClinchKind::Divisional.guaranteed_in_wildcard());
assert!( ClinchKind::WildCard.guaranteed_in_wildcard());
assert!(! ClinchKind::None.guaranteed_in_wildcard());
assert!(! ClinchKind::Postseason.guaranteed_in_wildcard());Sourcepub const fn potentially_in_wildcard(self) -> bool
pub const fn potentially_in_wildcard(self) -> bool
Whether the team has a possibility of playing in the Wild Card Series.
§Examples
use mlb_api::standings::ClinchKind;
assert!(! ClinchKind::Bye.guaranteed_in_wildcard());
assert!( ClinchKind::Divisional.guaranteed_in_wildcard());
assert!( ClinchKind::WildCard.guaranteed_in_wildcard());
assert!( ClinchKind::None.guaranteed_in_wildcard());
assert!( ClinchKind::Postseason.guaranteed_in_wildcard());Trait Implementations§
Source§impl Clone for ClinchKind
impl Clone for ClinchKind
Source§fn clone(&self) -> ClinchKind
fn clone(&self) -> ClinchKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClinchKind
impl Debug for ClinchKind
Source§impl Default for ClinchKind
impl Default for ClinchKind
Source§fn default() -> ClinchKind
fn default() -> ClinchKind
Source§impl<'de> Deserialize<'de> for ClinchKind
impl<'de> Deserialize<'de> for ClinchKind
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>,
Source§impl Ord for ClinchKind
impl Ord for ClinchKind
Source§fn cmp(&self, other: &ClinchKind) -> Ordering
fn cmp(&self, other: &ClinchKind) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ClinchKind
impl PartialEq for ClinchKind
Source§impl PartialOrd for ClinchKind
impl PartialOrd for ClinchKind
impl Copy for ClinchKind
impl Eq for ClinchKind
impl StructuralPartialEq for ClinchKind
Auto Trait Implementations§
impl Freeze for ClinchKind
impl RefUnwindSafe for ClinchKind
impl Send for ClinchKind
impl Sync for ClinchKind
impl Unpin for ClinchKind
impl UnsafeUnpin for ClinchKind
impl UnwindSafe for ClinchKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more