pub struct Player {Show 24 fields
pub id: String,
pub name: String,
pub surname: String,
pub bio: String,
pub pronouns: String,
pub alias: String,
pub niu: String,
pub email: String,
pub phone: String,
pub faculty: String,
pub isuab: bool,
pub how_did_you_hear_about_us: String,
pub social_media: Option<String>,
pub password: String,
pub player_number: i32,
pub state: PlayerState,
pub role: PlayerRole,
pub birth_date: NaiveDate,
pub accept_info_other_editions: bool,
pub next_feeding: Option<CustomDateTime>,
pub last_login: Option<NaiveDateTime>,
pub checkpoint: Option<NaiveDateTime>,
pub wants_to_be_zombie: i32,
pub register_date: Option<NaiveDateTime>,
}Expand description
Player struct
This is the main struct of the application.
It contains all the information about a player.
Fields§
§id: String§name: String§surname: String§bio: String§pronouns: String§alias: String§niu: String§email: String§phone: String§faculty: String§isuab: bool§how_did_you_hear_about_us: String§password: String§player_number: i32§state: PlayerState§role: PlayerRole§birth_date: NaiveDate§accept_info_other_editions: bool§next_feeding: Option<CustomDateTime>§last_login: Option<NaiveDateTime>§checkpoint: Option<NaiveDateTime>§wants_to_be_zombie: i32§register_date: Option<NaiveDateTime>Implementations§
Source§impl Player
impl Player
Sourcepub async fn recover_password(
&self,
username: String,
password: String,
) -> Result<(), String>
pub async fn recover_password( &self, username: String, password: String, ) -> Result<(), String>
Sourcepub async fn count_player(&self) -> Result<String, String>
pub async fn count_player(&self) -> Result<String, String>
Returns the number of players of each possible player state.
§Returns
Ok(String)if the count was successfully retrieved.Err(String)if an error occurred.
Sourcepub async fn admin_get_players(&self) -> Result<Vec<Player>, String>
pub async fn admin_get_players(&self) -> Result<Vec<Player>, String>
Get all players for admins
§Returns
Ok(Vec<Player>)if the players were successfully retrieved.Err(String)if an error occurred.
Sourcepub async fn feed_zombies_day(&self) -> Result<String, String>
pub async fn feed_zombies_day(&self) -> Result<String, String>
Adds a day to the zombies’ feeding time.
§Returns
Ok(String)if the zombies were successfully fed.Err(String)if an error occurred.
Sourcepub async fn kill_all_not_at_checkpoint(&self) -> Result<String, String>
pub async fn kill_all_not_at_checkpoint(&self) -> Result<String, String>
Kills all players did not go through the checkpoint.
§Returns
Ok(String)if the players were killed successfully.Err(String)if an error occurred.
Source§impl Player
Implement Player struct
impl Player
Implement Player struct
Sourcepub async fn new(
name: String,
surname: String,
pronouns: String,
alias: String,
niu: String,
email: String,
phone: String,
faculty: String,
isuab: bool,
how_did_you_hear_about_us: String,
social_media: Option<String>,
password: String,
birth_date: NaiveDate,
accept_info_other_editions: bool,
wants_to_be_zombie: i32,
) -> Self
pub async fn new( name: String, surname: String, pronouns: String, alias: String, niu: String, email: String, phone: String, faculty: String, isuab: bool, how_did_you_hear_about_us: String, social_media: Option<String>, password: String, birth_date: NaiveDate, accept_info_other_editions: bool, wants_to_be_zombie: i32, ) -> Self
Create a new player
§Arguments
name- The player’s namesurname- The player’s surnamepronouns- The player’s pronounsalias- The player’s aliasniu- The player’s NIUemail- The player’s emailsocial_media- The player’s social mediaphone- The player’s phone numberfaculty- The player’s facultyisuab- Whether the player is from UAB or nothow_did_you_hear_about_us- How the player heard about uspassword- The player’s passwordbirth_date- The player’s birth date
§Returns
A new player instance
Sourcefn get_next_player_number() -> i32
fn get_next_player_number() -> i32
Get the next player number
This is used to assign a unique number to each player.
§Returns
The next player number
Sourcepub async fn change_password(
&self,
old_password: String,
new_password: String,
) -> Result<(), String>
pub async fn change_password( &self, old_password: String, new_password: String, ) -> Result<(), String>
Sourcepub async fn edit(
&self,
bio: String,
pronouns: String,
alias: String,
email: String,
phone: String,
social_media: Option<String>,
accept_info_other_editions: bool,
) -> Result<(), String>
pub async fn edit( &self, bio: String, pronouns: String, alias: String, email: String, phone: String, social_media: Option<String>, accept_info_other_editions: bool, ) -> Result<(), String>
Edit player information.
§Arguments
pronouns- The player’s pronouns.alias- The player’s alias.email- The player’s email.phone- The player’s phone number.social_media- The player’s social media links.accept_info_other_editions- Whether the player accepts information about other editions.
§Returns
Ok(())if the player information was updated successfully.Err(String)if there was an error updating the player information.
Sourcepub async fn get_checkpoint(&self) -> Result<(i32, i32), String>
pub async fn get_checkpoint(&self) -> Result<(i32, i32), String>
Gets the checkpoints location
Method only available to human players.
§Returns
The location of the checkpoint
Sourcepub async fn is_zombie(&self) -> bool
pub async fn is_zombie(&self) -> bool
Check if a player is a zombie
This is checked from the PlayerState property.
§Returns
True if the player is a zombie, false otherwise
Sourcepub async fn ensure_zombie(&self) -> Result<(), String>
pub async fn ensure_zombie(&self) -> Result<(), String>
Ensure that a player is a zombie
Acts as a guard for the zombie.rs module.
§Returns
Ok if the player is a zombie, Err otherwise
§Usage
This function is used to ensure that a player is a zombie before performing certain actions:
pub async fn zombie_func() {
self.ensure_zombie().await?;
// The rest of the function
}Sourcepub async fn ensure_human(&self) -> Result<(), String>
pub async fn ensure_human(&self) -> Result<(), String>
Ensure that a player is a human
Acts as a guard for the human-only functions.
§Returns
Ok if the player is a human, Err otherwise.
§Usage
This function is used to ensure that a player is a human before performing certain actions:
pub async fn human_func() {
self.ensure_human().await?;
// The rest of the function
}Sourcepub async fn is_admin(&self) -> bool
pub async fn is_admin(&self) -> bool
Check if the player is an admin
This is checked from the PlayerRole property.
§Returns
True if the player is an admin, false otherwise
Sourcepub async fn ensure_admin(&self) -> Result<(), String>
pub async fn ensure_admin(&self) -> Result<(), String>
Ensure that a player is an admin
Acts as a guard for the admin.rs module.
§Returns
Ok if the player is an admin, Err otherwise
§Usage
This function is used to ensure that a player is an admin before performing certain actions:
pub fn admin_func() {
self.ensure_admin().await?;
// The rest of the function
}Source§impl Player
impl Player
Sourcepub async fn get_next_feeding(&self) -> Result<Option<CustomDateTime>, String>
pub async fn get_next_feeding(&self) -> Result<Option<CustomDateTime>, String>
Calculates the next feeding time for a zombie player.
Returns None if the player is not a zombie.
§Errors
Returns an error if the player is not a zombie.
Sourcepub async fn starvation(
&self,
) -> Result<Vec<(String, Option<CustomDateTime>)>, String>
pub async fn starvation( &self, ) -> Result<Vec<(String, Option<CustomDateTime>)>, String>
Sourcepub async fn hunt(
&self,
target: &Player,
feed1: Option<&Player>,
feed2: Option<&Player>,
) -> Result<(), String>
pub async fn hunt( &self, target: &Player, feed1: Option<&Player>, feed2: Option<&Player>, ) -> Result<(), String>
Sourcepub fn feeding_time_calc() -> Result<CustomDateTime, String>
pub fn feeding_time_calc() -> Result<CustomDateTime, String>
Sourcepub async fn monitor_zombie_death() -> !
pub async fn monitor_zombie_death() -> !
Monitors the zombie death and updates the player state accordingly.
Every minute, it checks if the player’s next feeding time has passed. If so, it updates the player’s state to Corpse and sets the next feeding time to None.
§Errors
Returns an error if the player is not a zombie.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Player
impl<'de> Deserialize<'de> for Player
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 Insertable<table> for Playerwhere
String: AsExpression<<id as Expression>::SqlType> + AsExpression<<name as Expression>::SqlType> + AsExpression<<surname as Expression>::SqlType> + AsExpression<<bio as Expression>::SqlType> + AsExpression<<pronouns as Expression>::SqlType> + AsExpression<<alias as Expression>::SqlType> + AsExpression<<niu as Expression>::SqlType> + AsExpression<<email as Expression>::SqlType> + AsExpression<<phone as Expression>::SqlType> + AsExpression<<faculty as Expression>::SqlType> + AsExpression<<how_did_you_hear_about_us as Expression>::SqlType> + AsExpression<<social_media as Expression>::SqlType> + AsExpression<<password as Expression>::SqlType>,
bool: AsExpression<<isuab as Expression>::SqlType> + AsExpression<<accept_info_other_editions as Expression>::SqlType>,
i32: AsExpression<<player_number as Expression>::SqlType> + AsExpression<<wants_to_be_zombie as Expression>::SqlType>,
PlayerState: AsExpression<<state as Expression>::SqlType>,
PlayerRole: AsExpression<<role as Expression>::SqlType>,
NaiveDate: AsExpression<<birth_date as Expression>::SqlType>,
CustomDateTime: AsExpression<<next_feeding as Expression>::SqlType>,
NaiveDateTime: AsExpression<<last_login as Expression>::SqlType> + AsExpression<<checkpoint as Expression>::SqlType> + AsExpression<<register_date as Expression>::SqlType>,
impl Insertable<table> for Playerwhere
String: AsExpression<<id as Expression>::SqlType> + AsExpression<<name as Expression>::SqlType> + AsExpression<<surname as Expression>::SqlType> + AsExpression<<bio as Expression>::SqlType> + AsExpression<<pronouns as Expression>::SqlType> + AsExpression<<alias as Expression>::SqlType> + AsExpression<<niu as Expression>::SqlType> + AsExpression<<email as Expression>::SqlType> + AsExpression<<phone as Expression>::SqlType> + AsExpression<<faculty as Expression>::SqlType> + AsExpression<<how_did_you_hear_about_us as Expression>::SqlType> + AsExpression<<social_media as Expression>::SqlType> + AsExpression<<password as Expression>::SqlType>,
bool: AsExpression<<isuab as Expression>::SqlType> + AsExpression<<accept_info_other_editions as Expression>::SqlType>,
i32: AsExpression<<player_number as Expression>::SqlType> + AsExpression<<wants_to_be_zombie as Expression>::SqlType>,
PlayerState: AsExpression<<state as Expression>::SqlType>,
PlayerRole: AsExpression<<role as Expression>::SqlType>,
NaiveDate: AsExpression<<birth_date as Expression>::SqlType>,
CustomDateTime: AsExpression<<next_feeding as Expression>::SqlType>,
NaiveDateTime: AsExpression<<last_login as Expression>::SqlType> + AsExpression<<checkpoint as Expression>::SqlType> + AsExpression<<register_date as Expression>::SqlType>,
Source§type Values = <(Option<Grouped<Eq<id, <String as AsExpression<<id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<surname, <String as AsExpression<<surname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<bio, <String as AsExpression<<bio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<pronouns, <String as AsExpression<<pronouns as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<alias, <String as AsExpression<<alias as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<niu, <String as AsExpression<<niu as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email, <String as AsExpression<<email as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<phone, <String as AsExpression<<phone as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<faculty, <String as AsExpression<<faculty as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<isuab, <bool as AsExpression<<isuab as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<how_did_you_hear_about_us, <String as AsExpression<<how_did_you_hear_about_us as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<social_media, <String as AsExpression<<social_media as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<password, <String as AsExpression<<password as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<player_number, <i32 as AsExpression<<player_number as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<state, <PlayerState as AsExpression<<state as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<role, <PlayerRole as AsExpression<<role as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<birth_date, <NaiveDate as AsExpression<<birth_date as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<accept_info_other_editions, <bool as AsExpression<<accept_info_other_editions as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<next_feeding, <CustomDateTime as AsExpression<<next_feeding as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<last_login, <NaiveDateTime as AsExpression<<last_login as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<checkpoint, <NaiveDateTime as AsExpression<<checkpoint as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<wants_to_be_zombie, <i32 as AsExpression<<wants_to_be_zombie as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<register_date, <NaiveDateTime as AsExpression<<register_date as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
type Values = <(Option<Grouped<Eq<id, <String as AsExpression<<id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<surname, <String as AsExpression<<surname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<bio, <String as AsExpression<<bio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<pronouns, <String as AsExpression<<pronouns as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<alias, <String as AsExpression<<alias as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<niu, <String as AsExpression<<niu as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email, <String as AsExpression<<email as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<phone, <String as AsExpression<<phone as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<faculty, <String as AsExpression<<faculty as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<isuab, <bool as AsExpression<<isuab as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<how_did_you_hear_about_us, <String as AsExpression<<how_did_you_hear_about_us as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<social_media, <String as AsExpression<<social_media as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<password, <String as AsExpression<<password as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<player_number, <i32 as AsExpression<<player_number as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<state, <PlayerState as AsExpression<<state as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<role, <PlayerRole as AsExpression<<role as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<birth_date, <NaiveDate as AsExpression<<birth_date as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<accept_info_other_editions, <bool as AsExpression<<accept_info_other_editions as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<next_feeding, <CustomDateTime as AsExpression<<next_feeding as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<last_login, <NaiveDateTime as AsExpression<<last_login as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<checkpoint, <NaiveDateTime as AsExpression<<checkpoint as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<wants_to_be_zombie, <i32 as AsExpression<<wants_to_be_zombie as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<register_date, <NaiveDateTime as AsExpression<<register_date as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
VALUES clause to insert these records Read moreSource§fn values(
self,
) -> <(Option<Eq<id, String>>, Option<Eq<name, String>>, Option<Eq<surname, String>>, Option<Eq<bio, String>>, Option<Eq<pronouns, String>>, Option<Eq<alias, String>>, Option<Eq<niu, String>>, Option<Eq<email, String>>, Option<Eq<phone, String>>, Option<Eq<faculty, String>>, Option<Eq<isuab, bool>>, Option<Eq<how_did_you_hear_about_us, String>>, Option<Eq<social_media, String>>, Option<Eq<password, String>>, Option<Eq<player_number, i32>>, Option<Eq<state, PlayerState>>, Option<Eq<role, PlayerRole>>, Option<Eq<birth_date, NaiveDate>>, Option<Eq<accept_info_other_editions, bool>>, Option<Eq<next_feeding, CustomDateTime>>, Option<Eq<last_login, NaiveDateTime>>, Option<Eq<checkpoint, NaiveDateTime>>, Option<Eq<wants_to_be_zombie, i32>>, Option<Eq<register_date, NaiveDateTime>>) as Insertable<table>>::Values
fn values( self, ) -> <(Option<Eq<id, String>>, Option<Eq<name, String>>, Option<Eq<surname, String>>, Option<Eq<bio, String>>, Option<Eq<pronouns, String>>, Option<Eq<alias, String>>, Option<Eq<niu, String>>, Option<Eq<email, String>>, Option<Eq<phone, String>>, Option<Eq<faculty, String>>, Option<Eq<isuab, bool>>, Option<Eq<how_did_you_hear_about_us, String>>, Option<Eq<social_media, String>>, Option<Eq<password, String>>, Option<Eq<player_number, i32>>, Option<Eq<state, PlayerState>>, Option<Eq<role, PlayerRole>>, Option<Eq<birth_date, NaiveDate>>, Option<Eq<accept_info_other_editions, bool>>, Option<Eq<next_feeding, CustomDateTime>>, Option<Eq<last_login, NaiveDateTime>>, Option<Eq<checkpoint, NaiveDateTime>>, Option<Eq<wants_to_be_zombie, i32>>, Option<Eq<register_date, NaiveDateTime>>) as Insertable<table>>::Values
Self::Values Read more§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
self into a given table. Read moreSource§impl<'insert> Insertable<table> for &'insert Playerwhere
&'insert String: AsExpression<<id as Expression>::SqlType> + AsExpression<<name as Expression>::SqlType> + AsExpression<<surname as Expression>::SqlType> + AsExpression<<bio as Expression>::SqlType> + AsExpression<<pronouns as Expression>::SqlType> + AsExpression<<alias as Expression>::SqlType> + AsExpression<<niu as Expression>::SqlType> + AsExpression<<email as Expression>::SqlType> + AsExpression<<phone as Expression>::SqlType> + AsExpression<<faculty as Expression>::SqlType> + AsExpression<<how_did_you_hear_about_us as Expression>::SqlType> + AsExpression<<social_media as Expression>::SqlType> + AsExpression<<password as Expression>::SqlType>,
&'insert bool: AsExpression<<isuab as Expression>::SqlType> + AsExpression<<accept_info_other_editions as Expression>::SqlType>,
&'insert i32: AsExpression<<player_number as Expression>::SqlType> + AsExpression<<wants_to_be_zombie as Expression>::SqlType>,
&'insert PlayerState: AsExpression<<state as Expression>::SqlType>,
&'insert PlayerRole: AsExpression<<role as Expression>::SqlType>,
&'insert NaiveDate: AsExpression<<birth_date as Expression>::SqlType>,
&'insert CustomDateTime: AsExpression<<next_feeding as Expression>::SqlType>,
&'insert NaiveDateTime: AsExpression<<last_login as Expression>::SqlType> + AsExpression<<checkpoint as Expression>::SqlType> + AsExpression<<register_date as Expression>::SqlType>,
impl<'insert> Insertable<table> for &'insert Playerwhere
&'insert String: AsExpression<<id as Expression>::SqlType> + AsExpression<<name as Expression>::SqlType> + AsExpression<<surname as Expression>::SqlType> + AsExpression<<bio as Expression>::SqlType> + AsExpression<<pronouns as Expression>::SqlType> + AsExpression<<alias as Expression>::SqlType> + AsExpression<<niu as Expression>::SqlType> + AsExpression<<email as Expression>::SqlType> + AsExpression<<phone as Expression>::SqlType> + AsExpression<<faculty as Expression>::SqlType> + AsExpression<<how_did_you_hear_about_us as Expression>::SqlType> + AsExpression<<social_media as Expression>::SqlType> + AsExpression<<password as Expression>::SqlType>,
&'insert bool: AsExpression<<isuab as Expression>::SqlType> + AsExpression<<accept_info_other_editions as Expression>::SqlType>,
&'insert i32: AsExpression<<player_number as Expression>::SqlType> + AsExpression<<wants_to_be_zombie as Expression>::SqlType>,
&'insert PlayerState: AsExpression<<state as Expression>::SqlType>,
&'insert PlayerRole: AsExpression<<role as Expression>::SqlType>,
&'insert NaiveDate: AsExpression<<birth_date as Expression>::SqlType>,
&'insert CustomDateTime: AsExpression<<next_feeding as Expression>::SqlType>,
&'insert NaiveDateTime: AsExpression<<last_login as Expression>::SqlType> + AsExpression<<checkpoint as Expression>::SqlType> + AsExpression<<register_date as Expression>::SqlType>,
Source§type Values = <(Option<Grouped<Eq<id, <&'insert String as AsExpression<<id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <&'insert String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<surname, <&'insert String as AsExpression<<surname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<bio, <&'insert String as AsExpression<<bio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<pronouns, <&'insert String as AsExpression<<pronouns as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<alias, <&'insert String as AsExpression<<alias as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<niu, <&'insert String as AsExpression<<niu as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email, <&'insert String as AsExpression<<email as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<phone, <&'insert String as AsExpression<<phone as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<faculty, <&'insert String as AsExpression<<faculty as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<isuab, <&'insert bool as AsExpression<<isuab as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<how_did_you_hear_about_us, <&'insert String as AsExpression<<how_did_you_hear_about_us as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<social_media, <&'insert String as AsExpression<<social_media as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<password, <&'insert String as AsExpression<<password as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<player_number, <&'insert i32 as AsExpression<<player_number as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<state, <&'insert PlayerState as AsExpression<<state as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<role, <&'insert PlayerRole as AsExpression<<role as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<birth_date, <&'insert NaiveDate as AsExpression<<birth_date as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<accept_info_other_editions, <&'insert bool as AsExpression<<accept_info_other_editions as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<next_feeding, <&'insert CustomDateTime as AsExpression<<next_feeding as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<last_login, <&'insert NaiveDateTime as AsExpression<<last_login as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<checkpoint, <&'insert NaiveDateTime as AsExpression<<checkpoint as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<wants_to_be_zombie, <&'insert i32 as AsExpression<<wants_to_be_zombie as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<register_date, <&'insert NaiveDateTime as AsExpression<<register_date as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
type Values = <(Option<Grouped<Eq<id, <&'insert String as AsExpression<<id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<name, <&'insert String as AsExpression<<name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<surname, <&'insert String as AsExpression<<surname as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<bio, <&'insert String as AsExpression<<bio as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<pronouns, <&'insert String as AsExpression<<pronouns as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<alias, <&'insert String as AsExpression<<alias as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<niu, <&'insert String as AsExpression<<niu as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email, <&'insert String as AsExpression<<email as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<phone, <&'insert String as AsExpression<<phone as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<faculty, <&'insert String as AsExpression<<faculty as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<isuab, <&'insert bool as AsExpression<<isuab as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<how_did_you_hear_about_us, <&'insert String as AsExpression<<how_did_you_hear_about_us as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<social_media, <&'insert String as AsExpression<<social_media as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<password, <&'insert String as AsExpression<<password as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<player_number, <&'insert i32 as AsExpression<<player_number as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<state, <&'insert PlayerState as AsExpression<<state as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<role, <&'insert PlayerRole as AsExpression<<role as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<birth_date, <&'insert NaiveDate as AsExpression<<birth_date as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<accept_info_other_editions, <&'insert bool as AsExpression<<accept_info_other_editions as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<next_feeding, <&'insert CustomDateTime as AsExpression<<next_feeding as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<last_login, <&'insert NaiveDateTime as AsExpression<<last_login as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<checkpoint, <&'insert NaiveDateTime as AsExpression<<checkpoint as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<wants_to_be_zombie, <&'insert i32 as AsExpression<<wants_to_be_zombie as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<register_date, <&'insert NaiveDateTime as AsExpression<<register_date as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
VALUES clause to insert these records Read moreSource§fn values(
self,
) -> <(Option<Eq<id, &'insert String>>, Option<Eq<name, &'insert String>>, Option<Eq<surname, &'insert String>>, Option<Eq<bio, &'insert String>>, Option<Eq<pronouns, &'insert String>>, Option<Eq<alias, &'insert String>>, Option<Eq<niu, &'insert String>>, Option<Eq<email, &'insert String>>, Option<Eq<phone, &'insert String>>, Option<Eq<faculty, &'insert String>>, Option<Eq<isuab, &'insert bool>>, Option<Eq<how_did_you_hear_about_us, &'insert String>>, Option<Eq<social_media, &'insert String>>, Option<Eq<password, &'insert String>>, Option<Eq<player_number, &'insert i32>>, Option<Eq<state, &'insert PlayerState>>, Option<Eq<role, &'insert PlayerRole>>, Option<Eq<birth_date, &'insert NaiveDate>>, Option<Eq<accept_info_other_editions, &'insert bool>>, Option<Eq<next_feeding, &'insert CustomDateTime>>, Option<Eq<last_login, &'insert NaiveDateTime>>, Option<Eq<checkpoint, &'insert NaiveDateTime>>, Option<Eq<wants_to_be_zombie, &'insert i32>>, Option<Eq<register_date, &'insert NaiveDateTime>>) as Insertable<table>>::Values
fn values( self, ) -> <(Option<Eq<id, &'insert String>>, Option<Eq<name, &'insert String>>, Option<Eq<surname, &'insert String>>, Option<Eq<bio, &'insert String>>, Option<Eq<pronouns, &'insert String>>, Option<Eq<alias, &'insert String>>, Option<Eq<niu, &'insert String>>, Option<Eq<email, &'insert String>>, Option<Eq<phone, &'insert String>>, Option<Eq<faculty, &'insert String>>, Option<Eq<isuab, &'insert bool>>, Option<Eq<how_did_you_hear_about_us, &'insert String>>, Option<Eq<social_media, &'insert String>>, Option<Eq<password, &'insert String>>, Option<Eq<player_number, &'insert i32>>, Option<Eq<state, &'insert PlayerState>>, Option<Eq<role, &'insert PlayerRole>>, Option<Eq<birth_date, &'insert NaiveDate>>, Option<Eq<accept_info_other_editions, &'insert bool>>, Option<Eq<next_feeding, &'insert CustomDateTime>>, Option<Eq<last_login, &'insert NaiveDateTime>>, Option<Eq<checkpoint, &'insert NaiveDateTime>>, Option<Eq<wants_to_be_zombie, &'insert i32>>, Option<Eq<register_date, &'insert NaiveDateTime>>) as Insertable<table>>::Values
Self::Values Read more§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
self into a given table. Read moreSource§impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14, __ST15, __ST16, __ST17, __ST18, __ST19, __ST20, __ST21, __ST22, __ST23> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14, __ST15, __ST16, __ST17, __ST18, __ST19, __ST20, __ST21, __ST22, __ST23), __DB> for Playerwhere
(String, String, String, String, String, String, String, String, String, String, bool, String, Option<String>, String, i32, PlayerState, PlayerRole, NaiveDate, bool, Option<CustomDateTime>, Option<NaiveDateTime>, Option<NaiveDateTime>, i32, Option<NaiveDateTime>): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14, __ST15, __ST16, __ST17, __ST18, __ST19, __ST20, __ST21, __ST22, __ST23), __DB>,
impl<__DB: Backend, __ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14, __ST15, __ST16, __ST17, __ST18, __ST19, __ST20, __ST21, __ST22, __ST23> Queryable<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14, __ST15, __ST16, __ST17, __ST18, __ST19, __ST20, __ST21, __ST22, __ST23), __DB> for Playerwhere
(String, String, String, String, String, String, String, String, String, String, bool, String, Option<String>, String, i32, PlayerState, PlayerRole, NaiveDate, bool, Option<CustomDateTime>, Option<NaiveDateTime>, Option<NaiveDateTime>, i32, Option<NaiveDateTime>): FromStaticSqlRow<(__ST0, __ST1, __ST2, __ST3, __ST4, __ST5, __ST6, __ST7, __ST8, __ST9, __ST10, __ST11, __ST12, __ST13, __ST14, __ST15, __ST16, __ST17, __ST18, __ST19, __ST20, __ST21, __ST22, __ST23), __DB>,
Source§type Row = (String, String, String, String, String, String, String, String, String, String, bool, String, Option<String>, String, i32, PlayerState, PlayerRole, NaiveDate, bool, Option<CustomDateTime>, Option<NaiveDateTime>, Option<NaiveDateTime>, i32, Option<NaiveDateTime>)
type Row = (String, String, String, String, String, String, String, String, String, String, bool, String, Option<String>, String, i32, PlayerState, PlayerRole, NaiveDate, bool, Option<CustomDateTime>, Option<NaiveDateTime>, Option<NaiveDateTime>, i32, Option<NaiveDateTime>)
Source§fn build(
row: (String, String, String, String, String, String, String, String, String, String, bool, String, Option<String>, String, i32, PlayerState, PlayerRole, NaiveDate, bool, Option<CustomDateTime>, Option<NaiveDateTime>, Option<NaiveDateTime>, i32, Option<NaiveDateTime>),
) -> Result<Self>
fn build( row: (String, String, String, String, String, String, String, String, String, String, bool, String, Option<String>, String, i32, PlayerState, PlayerRole, NaiveDate, bool, Option<CustomDateTime>, Option<NaiveDateTime>, Option<NaiveDateTime>, i32, Option<NaiveDateTime>), ) -> Result<Self>
Source§impl<__DB: Backend> QueryableByName<__DB> for Playerwhere
String: FromSql<SqlTypeOf<id>, __DB> + FromSql<SqlTypeOf<name>, __DB> + FromSql<SqlTypeOf<surname>, __DB> + FromSql<SqlTypeOf<bio>, __DB> + FromSql<SqlTypeOf<pronouns>, __DB> + FromSql<SqlTypeOf<alias>, __DB> + FromSql<SqlTypeOf<niu>, __DB> + FromSql<SqlTypeOf<email>, __DB> + FromSql<SqlTypeOf<phone>, __DB> + FromSql<SqlTypeOf<faculty>, __DB> + FromSql<SqlTypeOf<how_did_you_hear_about_us>, __DB> + FromSql<SqlTypeOf<password>, __DB>,
bool: FromSql<SqlTypeOf<isuab>, __DB> + FromSql<SqlTypeOf<accept_info_other_editions>, __DB>,
Option<String>: FromSql<SqlTypeOf<social_media>, __DB>,
i32: FromSql<SqlTypeOf<player_number>, __DB> + FromSql<SqlTypeOf<wants_to_be_zombie>, __DB>,
PlayerState: FromSql<SqlTypeOf<state>, __DB>,
PlayerRole: FromSql<SqlTypeOf<role>, __DB>,
NaiveDate: FromSql<SqlTypeOf<birth_date>, __DB>,
Option<CustomDateTime>: FromSql<SqlTypeOf<next_feeding>, __DB>,
Option<NaiveDateTime>: FromSql<SqlTypeOf<last_login>, __DB> + FromSql<SqlTypeOf<checkpoint>, __DB> + FromSql<SqlTypeOf<register_date>, __DB>,
impl<__DB: Backend> QueryableByName<__DB> for Playerwhere
String: FromSql<SqlTypeOf<id>, __DB> + FromSql<SqlTypeOf<name>, __DB> + FromSql<SqlTypeOf<surname>, __DB> + FromSql<SqlTypeOf<bio>, __DB> + FromSql<SqlTypeOf<pronouns>, __DB> + FromSql<SqlTypeOf<alias>, __DB> + FromSql<SqlTypeOf<niu>, __DB> + FromSql<SqlTypeOf<email>, __DB> + FromSql<SqlTypeOf<phone>, __DB> + FromSql<SqlTypeOf<faculty>, __DB> + FromSql<SqlTypeOf<how_did_you_hear_about_us>, __DB> + FromSql<SqlTypeOf<password>, __DB>,
bool: FromSql<SqlTypeOf<isuab>, __DB> + FromSql<SqlTypeOf<accept_info_other_editions>, __DB>,
Option<String>: FromSql<SqlTypeOf<social_media>, __DB>,
i32: FromSql<SqlTypeOf<player_number>, __DB> + FromSql<SqlTypeOf<wants_to_be_zombie>, __DB>,
PlayerState: FromSql<SqlTypeOf<state>, __DB>,
PlayerRole: FromSql<SqlTypeOf<role>, __DB>,
NaiveDate: FromSql<SqlTypeOf<birth_date>, __DB>,
Option<CustomDateTime>: FromSql<SqlTypeOf<next_feeding>, __DB>,
Option<NaiveDateTime>: FromSql<SqlTypeOf<last_login>, __DB> + FromSql<SqlTypeOf<checkpoint>, __DB> + FromSql<SqlTypeOf<register_date>, __DB>,
Source§impl<__DB: Backend> Selectable<__DB> for Player
impl<__DB: Backend> Selectable<__DB> for Player
Source§type SelectExpression = (id, name, surname, bio, pronouns, alias, niu, email, phone, faculty, isuab, how_did_you_hear_about_us, social_media, password, player_number, state, role, birth_date, accept_info_other_editions, next_feeding, last_login, checkpoint, wants_to_be_zombie, register_date)
type SelectExpression = (id, name, surname, bio, pronouns, alias, niu, email, phone, faculty, isuab, how_did_you_hear_about_us, social_media, password, player_number, state, role, birth_date, accept_info_other_editions, next_feeding, last_login, checkpoint, wants_to_be_zombie, register_date)
Source§fn construct_selection() -> Self::SelectExpression
fn construct_selection() -> Self::SelectExpression
impl UndecoratedInsertRecord<table> for Player
Auto Trait Implementations§
impl Freeze for Player
impl RefUnwindSafe for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl UnsafeUnpin for Player
impl UnwindSafe for Player
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DebugAny for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<DB, T> FromSqlRow<Untyped, DB> for Twhere
DB: Backend,
T: QueryableByName<DB>,
impl<DB, T> FromSqlRow<Untyped, DB> for Twhere
DB: Backend,
T: QueryableByName<DB>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
§fn as_select() -> SelectBy<T, DB>
fn as_select() -> SelectBy<T, DB>
Selectable] implementation. Read more§fn as_returning() -> SelectBy<Self, DB>
fn as_returning() -> SelectBy<Self, DB>
as_select that can be used with returning clauses