pub struct MsgUtil;Expand description
Helpers for message numbers and their protobuf flag.
Implementations§
Source§impl MsgUtil
impl MsgUtil
Sourcepub fn get_msg(msg: u32) -> Option<EMsg>
pub fn get_msg(msg: u32) -> Option<EMsg>
Strips the protobuf flag and returns the EMsg, or None if the number
isn’t a known message.
Sourcepub fn get_msg_from(msg: EMsg) -> Option<EMsg>
pub fn get_msg_from(msg: EMsg) -> Option<EMsg>
Strips the protobuf flag from an EMsg.
Sourcepub fn get_gc_msg(msg: u32) -> u32
pub fn get_gc_msg(msg: u32) -> u32
Strips the protobuf flag and returns the number. Use this for game
coordinator messages, whose numbers aren’t in EMsg.
Sourcepub fn is_proto_buf(msg: u32) -> bool
pub fn is_proto_buf(msg: u32) -> bool
Whether the message number has the protobuf flag.
Sourcepub fn is_proto_buf_from(msg: EMsg) -> bool
pub fn is_proto_buf_from(msg: EMsg) -> bool
Always false: an EMsg can’t carry the flag. Use
MsgUtil::is_proto_buf with the raw number instead.
Sourcepub fn make_msg(msg: EMsg, protobuf: bool) -> u32
pub fn make_msg(msg: EMsg, protobuf: bool) -> u32
Builds a message number, with the protobuf flag if asked. Returns the
raw number since a flagged value isn’t a valid EMsg.
Sourcepub fn make_gc_msg(msg: u32, protobuf: bool) -> u32
pub fn make_gc_msg(msg: u32, protobuf: bool) -> u32
Builds a game coordinator message number, with the protobuf flag if asked.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MsgUtil
impl RefUnwindSafe for MsgUtil
impl Send for MsgUtil
impl Sync for MsgUtil
impl Unpin for MsgUtil
impl UnsafeUnpin for MsgUtil
impl UnwindSafe for MsgUtil
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