Socket

Struct Socket 

Source
pub struct Socket { /* private fields */ }

Implementations§

Source§

impl Socket

Source

pub fn connect( addr: &str, port: u32, appear_online: bool, token: &str, ) -> Socket

Source

pub fn connected(&self) -> bool

Source

pub fn try_recv(&mut self) -> Option<String>

Source

pub fn join_match_by_id(&mut self, match_id: &str) -> u32

Source

pub fn join_match_by_token(&mut self, token: &str) -> u32

Source

pub fn leave_match(&mut self, match_id: &str) -> u32

Source

pub fn match_data_send(&mut self, match_id: &str, opcode: i32, data: &[u8])

Source

pub fn add_matchmaker( &mut self, min_count: u32, max_count: u32, query: &str, string_properties: &str, numeric_properties: &str, ) -> u32

usage example: add_matchmaker(2, 4, "+properties.engine:\\\"macroquad_matchmaking\\\"", "{\"engine\":\"macroquad_matchmaking\"}");

Source

pub fn create_match(&mut self) -> u32

Auto Trait Implementations§

§

impl !Freeze for Socket

§

impl !RefUnwindSafe for Socket

§

impl Send for Socket

§

impl Sync for Socket

§

impl Unpin for Socket

§

impl !UnwindSafe for Socket

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>,

Source§

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>,

Source§

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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,