pub enum RakPacket {
Offline(OfflinePacket),
Online(OnlinePacket),
}
Expand description
A wrapper or helper for both online and offline packets.
This allows for a single type to be read with Reader
and written with Writer
,
traits provided by binary_util
.
All packets sent are wrapped in this type, and can be unwrapped with the get_offline
or get_online
Variants§
Offline(OfflinePacket)
Online(OnlinePacket)
Implementations§
Source§impl RakPacket
impl RakPacket
pub fn is_online(&self) -> bool
pub fn get_offline(&self) -> Option<&OfflinePacket>
pub fn get_online(&self) -> Option<&OnlinePacket>
Trait Implementations§
Source§impl From<ConnectedPing> for RakPacket
impl From<ConnectedPing> for RakPacket
Source§fn from(packet: ConnectedPing) -> Self
fn from(packet: ConnectedPing) -> Self
Converts to this type from the input type.
Source§impl From<ConnectedPong> for RakPacket
impl From<ConnectedPong> for RakPacket
Source§fn from(packet: ConnectedPong) -> Self
fn from(packet: ConnectedPong) -> Self
Converts to this type from the input type.
Source§impl From<ConnectionAccept> for RakPacket
impl From<ConnectionAccept> for RakPacket
Source§fn from(packet: ConnectionAccept) -> Self
fn from(packet: ConnectionAccept) -> Self
Converts to this type from the input type.
Source§impl From<ConnectionRequest> for RakPacket
impl From<ConnectionRequest> for RakPacket
Source§fn from(packet: ConnectionRequest) -> Self
fn from(packet: ConnectionRequest) -> Self
Converts to this type from the input type.
Source§impl From<Disconnect> for RakPacket
impl From<Disconnect> for RakPacket
Source§fn from(packet: Disconnect) -> Self
fn from(packet: Disconnect) -> Self
Converts to this type from the input type.
Source§impl From<IncompatibleProtocolVersion> for RakPacket
impl From<IncompatibleProtocolVersion> for RakPacket
Source§fn from(packet: IncompatibleProtocolVersion) -> Self
fn from(packet: IncompatibleProtocolVersion) -> Self
Converts to this type from the input type.
Source§impl From<LostConnection> for RakPacket
impl From<LostConnection> for RakPacket
Source§fn from(packet: LostConnection) -> Self
fn from(packet: LostConnection) -> Self
Converts to this type from the input type.
Source§impl From<NewConnection> for RakPacket
impl From<NewConnection> for RakPacket
Source§fn from(packet: NewConnection) -> Self
fn from(packet: NewConnection) -> Self
Converts to this type from the input type.
Source§impl From<OfflinePacket> for RakPacket
impl From<OfflinePacket> for RakPacket
Source§fn from(packet: OfflinePacket) -> Self
fn from(packet: OfflinePacket) -> Self
Converts to this type from the input type.
Source§impl From<OnlinePacket> for RakPacket
impl From<OnlinePacket> for RakPacket
Source§fn from(packet: OnlinePacket) -> Self
fn from(packet: OnlinePacket) -> Self
Converts to this type from the input type.
Source§impl From<OpenConnectReply> for RakPacket
impl From<OpenConnectReply> for RakPacket
Source§fn from(packet: OpenConnectReply) -> Self
fn from(packet: OpenConnectReply) -> Self
Converts to this type from the input type.
Source§impl From<OpenConnectRequest> for RakPacket
impl From<OpenConnectRequest> for RakPacket
Source§fn from(packet: OpenConnectRequest) -> Self
fn from(packet: OpenConnectRequest) -> Self
Converts to this type from the input type.
Source§impl From<RakPacket> for ConnectedPing
impl From<RakPacket> for ConnectedPing
Source§impl From<RakPacket> for ConnectedPong
impl From<RakPacket> for ConnectedPong
Source§impl From<RakPacket> for ConnectionAccept
impl From<RakPacket> for ConnectionAccept
Source§impl From<RakPacket> for ConnectionRequest
impl From<RakPacket> for ConnectionRequest
Source§impl From<RakPacket> for Disconnect
impl From<RakPacket> for Disconnect
Source§impl From<RakPacket> for IncompatibleProtocolVersion
impl From<RakPacket> for IncompatibleProtocolVersion
Source§impl From<RakPacket> for LostConnection
impl From<RakPacket> for LostConnection
Source§impl From<RakPacket> for NewConnection
impl From<RakPacket> for NewConnection
Source§impl From<RakPacket> for OfflinePacket
impl From<RakPacket> for OfflinePacket
Source§impl From<RakPacket> for OnlinePacket
impl From<RakPacket> for OnlinePacket
Source§impl From<RakPacket> for OpenConnectReply
impl From<RakPacket> for OpenConnectReply
Source§impl From<RakPacket> for OpenConnectRequest
impl From<RakPacket> for OpenConnectRequest
Source§impl From<RakPacket> for SessionInfoReply
impl From<RakPacket> for SessionInfoReply
Source§impl From<RakPacket> for SessionInfoRequest
impl From<RakPacket> for SessionInfoRequest
Source§impl From<RakPacket> for UnconnectedPing
impl From<RakPacket> for UnconnectedPing
Source§impl From<RakPacket> for UnconnectedPong
impl From<RakPacket> for UnconnectedPong
Source§impl From<SessionInfoReply> for RakPacket
impl From<SessionInfoReply> for RakPacket
Source§fn from(packet: SessionInfoReply) -> Self
fn from(packet: SessionInfoReply) -> Self
Converts to this type from the input type.
Source§impl From<SessionInfoRequest> for RakPacket
impl From<SessionInfoRequest> for RakPacket
Source§fn from(packet: SessionInfoRequest) -> Self
fn from(packet: SessionInfoRequest) -> Self
Converts to this type from the input type.
Source§impl From<UnconnectedPing> for RakPacket
impl From<UnconnectedPing> for RakPacket
Source§fn from(packet: UnconnectedPing) -> Self
fn from(packet: UnconnectedPing) -> Self
Converts to this type from the input type.
Source§impl From<UnconnectedPong> for RakPacket
impl From<UnconnectedPong> for RakPacket
Source§fn from(packet: UnconnectedPong) -> Self
fn from(packet: UnconnectedPong) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RakPacket
impl RefUnwindSafe for RakPacket
impl Send for RakPacket
impl Sync for RakPacket
impl Unpin for RakPacket
impl UnwindSafe for RakPacket
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