pub struct ClientMsgProtobuf<TBody: Message + Default = SteamProtobufHeaderOnly> {
pub header: MsgHdrProtoBuf,
pub body: TBody,
pub payload: MsgBase,
}Expand description
A protobuf-backed client message.
Fields§
§header: MsgHdrProtoBufThe header of this message.
body: TBodyThe body of this message.
payload: MsgBaseThe raw payload that follows the body.
Implementations§
Source§impl<TBody> ClientMsgProtobuf<TBody>
impl<TBody> ClientMsgProtobuf<TBody>
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. The body is decoded from the bytes after the header.
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) -> &MsgHdrProtoBuf
pub fn header(&self) -> &MsgHdrProtoBuf
The header of this message.
Sourcepub fn header_mut(&mut self) -> &mut MsgHdrProtoBuf
pub fn header_mut(&mut self) -> &mut MsgHdrProtoBuf
The mutable header of this message.
Sourcepub fn proto_header(&self) -> &CMsgProtoBufHeader
pub fn proto_header(&self) -> &CMsgProtoBufHeader
Shorthand for the protobuf header.
Sourcepub fn proto_header_mut(&mut self) -> &mut CMsgProtoBufHeader
pub fn proto_header_mut(&mut self) -> &mut CMsgProtoBufHeader
Mutable shorthand for the protobuf header.
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 ClientMsgProtobuf<TBody>
impl<TBody> IClientMsg for ClientMsgProtobuf<TBody>
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 ClientMsgProtobuf<TBody>where
TBody: Freeze,
impl<TBody> RefUnwindSafe for ClientMsgProtobuf<TBody>where
TBody: RefUnwindSafe,
impl<TBody> Send for ClientMsgProtobuf<TBody>
impl<TBody> Sync for ClientMsgProtobuf<TBody>
impl<TBody> Unpin for ClientMsgProtobuf<TBody>where
TBody: Unpin,
impl<TBody> UnsafeUnpin for ClientMsgProtobuf<TBody>where
TBody: UnsafeUnpin,
impl<TBody> UnwindSafe for ClientMsgProtobuf<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