pub struct ClientMsg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,{
pub header: ExtendedClientMsgHdr,
pub body: TBody,
pub payload: MsgBase,
}Expand description
A struct-backed client message with an extended header.
Fields§
§header: ExtendedClientMsgHdrThe header of this message.
body: TBodyThe body of this message.
payload: MsgBaseThe raw payload that follows the body.
Implementations§
Source§impl<TBody> ClientMsg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
impl<TBody> ClientMsg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
Sourcepub fn new(e_msg: EMsg) -> Self
pub fn new(e_msg: EMsg) -> Self
Creates a new message of the given type. The type is stored in the header too.
Sourcepub fn with_payload_reserve(e_msg: EMsg, payload_reserve: usize) -> Self
pub fn with_payload_reserve(e_msg: EMsg, payload_reserve: usize) -> Self
Like new, but reserves payload_reserve bytes for the payload.
Sourcepub fn reply(e_msg: EMsg, reply_to: &dyn IClientMsg) -> Self
pub fn reply(e_msg: EMsg, reply_to: &dyn IClientMsg) -> Self
Creates a reply to reply_to, targeting its source job.
Sourcepub fn from_packet(msg: &dyn IPacketMsg) -> Result<Self, SteamError>
pub fn from_packet(msg: &dyn IPacketMsg) -> Result<Self, SteamError>
Parses a received packet.
Sourcepub fn body_mut(&mut self) -> &mut TBody
pub fn body_mut(&mut self) -> &mut TBody
The mutable body structure of this message.
Sourcepub fn header(&self) -> &ExtendedClientMsgHdr
pub fn header(&self) -> &ExtendedClientMsgHdr
The header of this message.
Sourcepub fn header_mut(&mut self) -> &mut ExtendedClientMsgHdr
pub fn header_mut(&mut self) -> &mut ExtendedClientMsgHdr
The mutable header of this message.
Sourcepub fn payload_mut(&mut self) -> &mut MsgBase
pub fn payload_mut(&mut self) -> &mut MsgBase
The mutable payload buffer of this message.
Trait Implementations§
Source§impl<TBody> IClientMsg for ClientMsg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
impl<TBody> IClientMsg for ClientMsg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
Source§fn session_id(&self) -> i32
fn session_id(&self) -> i32
The session id of this client message.
Source§fn set_session_id(&mut self, id: i32)
fn set_session_id(&mut self, id: i32)
Sets the session id of this client message.
Source§fn set_steam_id(&mut self, id: SteamID)
fn set_steam_id(&mut self, id: SteamID)
Sets the SteamID of this client message.
Source§fn target_job_id(&self) -> JobID
fn target_job_id(&self) -> JobID
The target job id of this client message.
Source§fn set_target_job_id(&mut self, id: JobID)
fn set_target_job_id(&mut self, id: JobID)
Sets the target job id of this client message.
Source§fn source_job_id(&self) -> JobID
fn source_job_id(&self) -> JobID
The source job id of this client message.
Source§fn set_source_job_id(&mut self, id: JobID)
fn set_source_job_id(&mut self, id: JobID)
Sets the source job id of this client message.
Auto Trait Implementations§
impl<TBody> Freeze for ClientMsg<TBody>where
TBody: Freeze,
impl<TBody> RefUnwindSafe for ClientMsg<TBody>where
TBody: RefUnwindSafe,
impl<TBody> Send for ClientMsg<TBody>
impl<TBody> Sync for ClientMsg<TBody>
impl<TBody> Unpin for ClientMsg<TBody>where
TBody: Unpin,
impl<TBody> UnsafeUnpin for ClientMsg<TBody>where
TBody: UnsafeUnpin,
impl<TBody> UnwindSafe for ClientMsg<TBody>where
TBody: UnwindSafe,
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