pub trait PlayerIdentity {
// Required methods
fn player_id(&self) -> i64;
fn username(&self) -> &str;
fn avatar_url(&self) -> &str;
// Provided method
fn name(&self) -> Option<&PlayerName> { ... }
}Expand description
Core player identity - the immutable parts that identify a player.
This is embedded in all player-related structs to avoid field duplication. Contains the fields that are constant for a player’s session.
Required Methods§
Sourcefn username(&self) -> &str
fn username(&self) -> &str
Get the raw Discord username (the unique handle). For display, use name().
Sourcefn avatar_url(&self) -> &str
fn avatar_url(&self) -> &str
Get avatar URL.
Provided Methods§
Sourcefn name(&self) -> Option<&PlayerName>
fn name(&self) -> Option<&PlayerName>
What to call this player in their current context, if the server
resolved it. None means “show username”.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".