pub enum DfsPosition {
Qb,
Rb,
Wr,
Te,
Dst,
}Expand description
A daily fantasy sports roster position for an NFL player or team defense.
String parsing is ASCII case-insensitive and accepts QB, RB, WR, TE, and DST.
DEF and D are also accepted as aliases for Dst. Conversion to String
and SQLx storage use the uppercase position names, with DST for defense/special teams.
§Examples
use nfl_model::DfsPosition;
let position: DfsPosition = "def".parse()?;
assert!(position.is_defense());
assert_eq!(String::from(position), "DST");Variants§
Qb
Quarterback (QB).
Rb
Running back (RB).
Wr
Wide receiver (WR).
Te
Tight end (TE).
Dst
Team defense and special teams (DST).
Implementations§
Source§impl DfsPosition
impl DfsPosition
Sourcepub fn is_defense(&self) -> bool
pub fn is_defense(&self) -> bool
Return whether this position represents a team defense rather than an individual player.
Trait Implementations§
Source§impl Clone for DfsPosition
impl Clone for DfsPosition
impl Copy for DfsPosition
Source§impl Debug for DfsPosition
impl Debug for DfsPosition
Source§impl<'r> Decode<'r, Sqlite> for DfsPosition
impl<'r> Decode<'r, Sqlite> for DfsPosition
Source§impl<'q, DB: Database> Encode<'q, DB> for DfsPositionwhere
&'q str: Encode<'q, DB>,
impl<'q, DB: Database> Encode<'q, DB> for DfsPositionwhere
&'q str: Encode<'q, DB>,
Source§fn encode_by_ref(
&self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer, ) -> Result<IsNull, BoxDynError>
fn size_hint(&self) -> usize
§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Send + Sync>>where
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
impl Eq for DfsPosition
Source§impl<'_derivative_strum> From<&'_derivative_strum DfsPosition> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum DfsPosition> for &'static str
Source§fn from(x: &'_derivative_strum DfsPosition) -> &'static str
fn from(x: &'_derivative_strum DfsPosition) -> &'static str
Converts to this type from the input type.
Source§impl From<DfsPosition> for &'static str
impl From<DfsPosition> for &'static str
Source§fn from(x: DfsPosition) -> &'static str
fn from(x: DfsPosition) -> &'static str
Converts to this type from the input type.
Source§impl From<DfsPosition> for String
impl From<DfsPosition> for String
Source§fn from(value: DfsPosition) -> Self
fn from(value: DfsPosition) -> Self
Converts to this type from the input type.
Source§impl From<DfsPosition> for DfsPositionSlotType
impl From<DfsPosition> for DfsPositionSlotType
Source§fn from(position: DfsPosition) -> Self
fn from(position: DfsPosition) -> Self
Converts to this type from the input type.
Source§impl FromStr for DfsPosition
impl FromStr for DfsPosition
Source§impl Hash for DfsPosition
impl Hash for DfsPosition
Source§impl PartialEq for DfsPosition
impl PartialEq for DfsPosition
impl StructuralPartialEq for DfsPosition
Source§impl TryFrom<&str> for DfsPosition
impl TryFrom<&str> for DfsPosition
Auto Trait Implementations§
impl Freeze for DfsPosition
impl RefUnwindSafe for DfsPosition
impl Send for DfsPosition
impl Sync for DfsPosition
impl Unpin for DfsPosition
impl UnsafeUnpin for DfsPosition
impl UnwindSafe for DfsPosition
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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