Pumpkin/crates/pumpkin-config/src/whitelist.rs
2026-08-06 12:56:40 +02:00

26 lines
692 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// Represents an entry in the server whitelist.
///
/// Stores the player's UUID and username.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct WhitelistEntry {
/// The UUID of the whitelisted player.
pub uuid: Uuid,
/// The username of the whitelisted player.
pub name: String,
}
impl WhitelistEntry {
/// Creates a new whitelist entry with the given UUID and name.
///
/// # Arguments
/// * `uuid` – The UUID of the player.
/// * `name` – The username of the player.
#[must_use]
pub const fn new(uuid: Uuid, name: String) -> Self {
Self { uuid, name }
}
}