pub struct RawNetMessage {
pub kind: MsgKind,
pub is_protobuf: bool,
pub header: NetMessageHeader,
pub data: BytesMut,
/* private fields */
}Fields§
§kind: MsgKind§is_protobuf: bool§header: NetMessageHeader§data: BytesMutImplementations§
Source§impl RawNetMessage
impl RawNetMessage
pub fn read<Body: Into<Bytes>>(body: Body) -> Result<Self, NetworkError>
pub fn from_message<T: NetMessage>( header: NetMessageHeader, message: T, ) -> Result<Self, NetworkError>
pub fn from_message_with_kind<T: EncodableMessage, K: MsgKindEnum>( header: NetMessageHeader, message: T, kind: K, is_protobuf: bool, ) -> Result<Self, NetworkError>
Sourcepub fn into_bytes(self) -> BytesMut
pub fn into_bytes(self) -> BytesMut
Return a buffer containing the raw message bytes
Source§impl RawNetMessage
impl RawNetMessage
pub fn into_header_and_message<T: NetMessage>( self, ) -> Result<(NetMessageHeader, T), NetworkError>
pub fn into_message<T: NetMessage>(self) -> Result<T, NetworkError>
Trait Implementations§
Source§impl Clone for RawNetMessage
impl Clone for RawNetMessage
Source§fn clone(&self) -> RawNetMessage
fn clone(&self) -> RawNetMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RawNetMessage
impl RefUnwindSafe for RawNetMessage
impl Send for RawNetMessage
impl Sync for RawNetMessage
impl Unpin for RawNetMessage
impl UnsafeUnpin for RawNetMessage
impl UnwindSafe for RawNetMessage
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