pub type Admin = Player;Expand description
Represents an admin user.
Aliased Type§
pub struct Admin {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>,
}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 Admin
impl Admin
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.