pub struct PlayerName {
pub discord: String,
pub runecast: Option<String>,
}Expand description
What to call a player, in the context this message was sent in.
Show runecast when it is set, otherwise
discord. A viewer who has turned on austere nicknames is
shown discord always. shown applies that rule.
use runecast_protocol::PlayerName;
let name = PlayerName::new("Ada", Some("Rune Queen".to_string()));
assert_eq!(name.shown(false), "Rune Queen");
assert_eq!(name.shown(true), "Ada");Fields§
§discord: StringThe name Discord itself would show here: the player’s nickname in this server (when the lobby is in one and they have one there), else their Discord display name, else their username.
runecast: Option<String>The nickname the player chose in RuneCast, if any.
Implementations§
Trait Implementations§
Source§impl Clone for PlayerName
impl Clone for PlayerName
Source§fn clone(&self) -> PlayerName
fn clone(&self) -> PlayerName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlayerName
impl Debug for PlayerName
Source§impl<'de> Deserialize<'de> for PlayerName
impl<'de> Deserialize<'de> for PlayerName
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PlayerName
Source§impl PartialEq for PlayerName
impl PartialEq for PlayerName
Source§impl Serialize for PlayerName
impl Serialize for PlayerName
impl StructuralPartialEq for PlayerName
Auto Trait Implementations§
impl Freeze for PlayerName
impl RefUnwindSafe for PlayerName
impl Send for PlayerName
impl Sync for PlayerName
impl Unpin for PlayerName
impl UnsafeUnpin for PlayerName
impl UnwindSafe for PlayerName
Blanket Implementations§
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
Mutably borrows from an owned value. Read more