pub struct Networking { /* private fields */ }Expand description
Access to the steam networking interface
Implementations§
Source§impl Networking
impl Networking
Sourcepub fn accept_p2p_session(&self, user: SteamId) -> bool
pub fn accept_p2p_session(&self, user: SteamId) -> bool
Accepts incoming packets from the given user
Should only be called in response to a P2PSessionRequest.
Sourcepub fn close_p2p_session(&self, user: SteamId) -> bool
pub fn close_p2p_session(&self, user: SteamId) -> bool
Closes the p2p connection between the given user
Sourcepub fn get_p2p_session_state(&self, user: SteamId) -> Option<P2PSessionState>
pub fn get_p2p_session_state(&self, user: SteamId) -> Option<P2PSessionState>
Gets the connection state to the specified user
Returns the P2P session state if a connection exists with the user, or None if no connection exists.
Sourcepub fn send_p2p_packet(
&self,
remote: SteamId,
send_type: SendType,
data: &[u8],
) -> bool
pub fn send_p2p_packet( &self, remote: SteamId, send_type: SendType, data: &[u8], ) -> bool
Sends a packet to the user, starting the connection if it isn’t started already
Sourcepub fn send_p2p_packet_on_channel(
&self,
remote: SteamId,
send_type: SendType,
data: &[u8],
channel: i32,
) -> bool
pub fn send_p2p_packet_on_channel( &self, remote: SteamId, send_type: SendType, data: &[u8], channel: i32, ) -> bool
Sends a packet to the user on a specific channel
Sourcepub fn is_p2p_packet_available(&self) -> Option<usize>
pub fn is_p2p_packet_available(&self) -> Option<usize>
Returns whether there is a packet queued that can be read.
Returns the size of the queued packet if any.
Sourcepub fn is_p2p_packet_available_on_channel(&self, channel: i32) -> Option<usize>
pub fn is_p2p_packet_available_on_channel(&self, channel: i32) -> Option<usize>
Returns whether there is a packet available on a specific channel
Auto Trait Implementations§
impl Freeze for Networking
impl RefUnwindSafe for Networking
impl !Send for Networking
impl !Sync for Networking
impl Unpin for Networking
impl UnsafeUnpin for Networking
impl UnwindSafe for Networking
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