pub struct User {}
Expand description
The User API gives you access to the currently signed in user’s name.
Implementations
sourceimpl User
impl User
sourcepub fn display_name() -> Option<String>
pub fn display_name() -> Option<String>
Returns the display name of the currently signed in user.
If the signed in user does not have a preferred nickname, their real name will be used instead. If no name is available the function will return None.
sourcepub fn id() -> Option<UserId>
pub fn id() -> Option<UserId>
Returns the id of the currently signed in user.
This is the Embark external user id and is safe for external users to know.
sourcepub fn id_of(player_id: u64) -> Option<UserId>
pub fn id_of(player_id: u64) -> Option<UserId>
Returns the user id of the player with the given player_id
.
Returns None
if player is not on server or is not logged in.
sourcepub fn display_name_of(player_id: u64) -> Option<String>
pub fn display_name_of(player_id: u64) -> Option<String>
Returns the display name of the user with the given player_id
.
Returns None
if player is not on server or is not logged in.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more