pub struct Board<'a> {
pub position: u16,
pub min: i16,
pub max: i16,
pub time: bool,
pub decimals: u8,
pub name: &'a str,
}Fields§
§position: u16The order in which the board should be displayed, ascending.
min: i16The minimum value for a score to be added to the board.
It’s possible to have negative scores when the app needs scores on the board
to be ordered in ascending order rather than descending.
So the default minimum is i16::MIN rather than 0.
max: i16The maximum value for a score to be added to the board.
Useful for filtering out obvious cheating.
time: boolIf the score should be formatted as time.
decimals: u8Digits after decimal point.
name: &'a strHuman-readable board name.
Implementations§
Source§impl Board<'_>
impl Board<'_>
Sourcepub const fn validate(&self) -> Result<(), BoardValidationError>
pub const fn validate(&self) -> Result<(), BoardValidationError>
Validate board attributes.
§Errors
Returns BoardValidationError if any of the attributes are not valid.
Trait Implementations§
Source§impl<'de: 'a, 'a> Deserialize<'de> for Board<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Board<'a>
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
impl<'a> Eq for Board<'a>
impl<'a> StructuralPartialEq for Board<'a>
Auto Trait Implementations§
impl<'a> Freeze for Board<'a>
impl<'a> RefUnwindSafe for Board<'a>
impl<'a> Send for Board<'a>
impl<'a> Sync for Board<'a>
impl<'a> Unpin for Board<'a>
impl<'a> UnwindSafe for Board<'a>
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