#[repr(C)]pub struct NpcMessage {
pub timestamp: u64,
/* private fields */
}
Expand description
An NPC chat message.
Strings are available for the duration of the call.
If you need it for longer than that, consider converting it to NpcMessageOwned
.
let owned = message.to_owned();
let owned: NpcMessageOwned = message.into();
Fields§
§timestamp: u64
Time since epoch in nanoseconds.
This can be used to sort messages, when they are out of order.
Implementations§
Source§impl NpcMessage
impl NpcMessage
Sourcepub fn to_owned(&self) -> NpcMessageOwned
pub fn to_owned(&self) -> NpcMessageOwned
Converts the message to its owned counterpart.
Sourcepub fn character_name(&self) -> &str
pub fn character_name(&self) -> &str
Returns the character name of the player that sent the message.
Sourcepub fn character_name_ptr(&self) -> *const c_char
pub fn character_name_ptr(&self) -> *const c_char
Returns the character name as raw pointer.
Sourcepub fn character_name_len(&self) -> usize
pub fn character_name_len(&self) -> usize
Returns the account name length.
Trait Implementations§
Source§impl Clone for NpcMessage
impl Clone for NpcMessage
Source§fn clone(&self) -> NpcMessage
fn clone(&self) -> NpcMessage
Returns a copy of the value. Read more
1.0.0 · 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 NpcMessage
impl Debug for NpcMessage
Source§impl From<&NpcMessage> for NpcMessageOwned
impl From<&NpcMessage> for NpcMessageOwned
Source§fn from(msg: &NpcMessage) -> Self
fn from(msg: &NpcMessage) -> Self
Converts to this type from the input type.
Source§impl From<NpcMessage> for NpcMessageOwned
impl From<NpcMessage> for NpcMessageOwned
Source§fn from(msg: NpcMessage) -> Self
fn from(msg: NpcMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NpcMessage
impl RefUnwindSafe for NpcMessage
impl !Send for NpcMessage
impl !Sync for NpcMessage
impl Unpin for NpcMessage
impl UnwindSafe for NpcMessage
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