Struct steamworks::Networking

source ·
pub struct Networking<Manager> { /* private fields */ }
Expand description

Access to the steam networking interface

Implementations§

source§

impl<Manager> Networking<Manager>

source

pub fn accept_p2p_session(&self, user: SteamId)

Accepts incoming packets from the given user

Should only be called in response to a P2PSessionRequest.

source

pub fn close_p2p_session(&self, user: SteamId)

Closes the p2p connection between the given user

source

pub fn send_p2p_packet( &self, remote: SteamId, send_type: SendType, data: &[u8] ) -> bool

Sends a packet to the start user starting the connection if it isn’t started already

source

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.

source

pub fn read_p2p_packet(&self, buf: &mut [u8]) -> Option<(SteamId, usize)>

Attempts to read a queued packet into the buffer if there are any.

Returns the steam id of the sender and the size of the packet.

Auto Trait Implementations§

§

impl<Manager> RefUnwindSafe for Networking<Manager>
where Manager: RefUnwindSafe,

§

impl<Manager> !Send for Networking<Manager>

§

impl<Manager> !Sync for Networking<Manager>

§

impl<Manager> Unpin for Networking<Manager>

§

impl<Manager> UnwindSafe for Networking<Manager>
where Manager: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.