[][src]Struct sudoku_backend::ops::SanitisedUserData

pub struct SanitisedUserData {
    pub username: String,
    pub created_at: DateTime<FixedOffset>,
    pub is_admin: bool,
    pub points_total: u64,
    pub games_total: u64,
    pub games_total_easy: u64,
    pub games_total_medium: u64,
    pub games_total_hard: u64,
}

Data returned to authenticating client, with a free conversion from a User.

Consult doc/user.md for more details.

Examples

assert_eq!(SanitisedUserData::from(User {
               id: Some(12),
               username: "karolsw3".to_string(),
               password: "$rscrypt$0$EAgC$p9qwIwAVjdqhKvTR+&c.".to_string(),
               email: "karol.sw3@gmail.com".to_string(),
               created_at: NaiveDate::from_ymd(2018, 7, 7).and_hms(17, 6, 29),
               is_admin: true,
               points_total: 1750,
               games_total: 3,
               games_total_easy: 2,
               games_total_medium: 1,
               games_total_hard: 0,
           }),
           SanitisedUserData {
               username: "karolsw3".to_string(),
               created_at: DateTime::parse_from_rfc3339("2018-07-07T17:06:29Z").unwrap(),
               is_admin: true,
               points_total: 1750,
               games_total: 3,
               games_total_easy: 2,
               games_total_medium: 1,
               games_total_hard: 0,
           });

Fields

User's name or "login" or whatever.

Time user was created.

Whether the user has administrative privileges.

Sum total of the user's points, calculated according to doc/scoring.md#endgame-formula.

Total amount of games played.

Amount easy of games played.

Amount medium of games played.

Amount hard of games played.

Trait Implementations

impl PartialEq<SanitisedUserData> for SanitisedUserData
[src]

impl Clone for SanitisedUserData
[src]

Performs copy-assignment from source. Read more

impl From<User> for SanitisedUserData
[src]

impl Ord for SanitisedUserData
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Eq for SanitisedUserData
[src]

impl PartialOrd<SanitisedUserData> for SanitisedUserData
[src]

impl Debug for SanitisedUserData
[src]

impl Hash for SanitisedUserData
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for SanitisedUserData
[src]

impl<'de> Deserialize<'de> for SanitisedUserData
[src]

Auto Trait Implementations

impl Send for SanitisedUserData

impl Sync for SanitisedUserData

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Typeable for T where
    T: Any
[src]

Get the TypeId of this object.

impl<T> IntoSql for T
[src]

Convert self to an expression for Diesel's query builder. Read more

Convert &self to an expression for Diesel's query builder. Read more