#[repr(C)]pub struct SquadMessage {
pub channel_id: u32,
pub channel_type: ChannelType,
pub subgroup: u8,
/* private fields */
}
Expand description
A squad/party chat message.
Strings are available for the duration of the call.
If you need it for longer than that, consider converting it to SquadMessageOwned
.
let owned = message.to_owned();
let owned: SquadMessageOwned = message.into();
Fields§
§channel_id: u32
A unique identifier for the channel this chat message was sent over.
Can be used to, for example, differentiate between squad messages sent to different squads.
channel_type: ChannelType
Whether the message is sent in a party or a squad.
Note that messages sent to the party chat while in a squad will have the type ChannelType::Squad
.
subgroup: u8
The subgroup the message was sent to, or 0
if it was sent to the entire squad.
Implementations§
Source§impl SquadMessage
impl SquadMessage
Sourcepub fn to_owned(&self) -> SquadMessageOwned
pub fn to_owned(&self) -> SquadMessageOwned
Converts the squad message to its owned counterpart.
Sourcepub fn flags(&self) -> SquadMessageFlags
pub fn flags(&self) -> SquadMessageFlags
Returns the message flags.
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
Returns the message flags.
Sourcepub fn timestamp_str(&self) -> &str
pub fn timestamp_str(&self) -> &str
Returns the timestamp as string.
Sourcepub fn timestamp_ptr(&self) -> *const c_char
pub fn timestamp_ptr(&self) -> *const c_char
Returns the timestamp string as raw pointer.
Sourcepub fn timestamp_len(&self) -> usize
pub fn timestamp_len(&self) -> usize
Returns the timestamp string length.
Sourcepub fn timestamp(&self) -> Option<DateTime<FixedOffset>>
pub fn timestamp(&self) -> Option<DateTime<FixedOffset>>
Returns the timestamp when the message was received.
This is the “absolute ordering” for chat messages, however the time can potentially differ several seconds between the client and server because of latency and clock skew.
Sourcepub fn account_name(&self) -> &str
pub fn account_name(&self) -> &str
Returns the account name of the player that sent the message.
Sourcepub fn account_name_ptr(&self) -> *const c_char
pub fn account_name_ptr(&self) -> *const c_char
Returns the account name as raw pointer.
Sourcepub fn account_name_len(&self) -> usize
pub fn account_name_len(&self) -> usize
Returns the account name length.
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 SquadMessage
impl Clone for SquadMessage
Source§fn clone(&self) -> SquadMessage
fn clone(&self) -> SquadMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more