pub struct Player {
pub nickname: String,
pub full_name: String,
}
Fields§
§nickname: String
§full_name: String
Implementations§
Source§impl Player
impl Player
Sourcepub fn build(text: &str) -> Result<Player>
pub fn build(text: &str) -> Result<Player>
The player pragma indicates the nickname and full name of a player.
§Examples
let text = "#player1 xXFerrisXx Ferris The Crab";
let player = Player::build(text)?;
assert_eq!(
player,
Player {
nickname: "xXFerrisXx".to_string(),
full_name: "Ferris The Crab".to_string(),
}
);
§Errors
If the nickname or full name tokens are missing, a
MissingToken
error is returned
Trait Implementations§
impl StructuralPartialEq 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 UnwindSafe for Player
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