pub struct Msg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,{
pub header: MsgHdr,
pub body: TBody,
pub payload: MsgBase,
pub session_id: i32,
pub steam_id: Option<SteamID>,
}Expand description
A struct-backed message without session or client information.
Fields§
§header: MsgHdrThe header of this message.
body: TBodyThe body of this message.
payload: MsgBaseThe raw payload that follows the body.
session_id: i32Session id. MsgHdr has no field for it, so it’s only kept locally.
steam_id: Option<SteamID>SteamID. MsgHdr has no field for it, so it’s only kept locally.
Implementations§
Source§impl<TBody> Msg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
impl<TBody> Msg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
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_mut(&mut self) -> &mut MsgHdr
pub fn header_mut(&mut self) -> &mut MsgHdr
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 Msg<TBody>where
TBody: SteamSerializableDeserialize + ISteamSerializableMessage,
impl<TBody> IClientMsg for Msg<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 Msg<TBody>where
TBody: Freeze,
impl<TBody> RefUnwindSafe for Msg<TBody>where
TBody: RefUnwindSafe,
impl<TBody> Send for Msg<TBody>
impl<TBody> Sync for Msg<TBody>
impl<TBody> Unpin for Msg<TBody>where
TBody: Unpin,
impl<TBody> UnsafeUnpin for Msg<TBody>where
TBody: UnsafeUnpin,
impl<TBody> UnwindSafe for Msg<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