pub struct P2P(/* private fields */);Implementations§
Source§impl P2P
impl P2P
Sourcepub fn raw_handle(&self) -> EOS_HP2P
pub fn raw_handle(&self) -> EOS_HP2P
Examples found in repository?
examples/platform_minimal.rs (line 34)
9fn main() -> Result<(), Box<dyn std::error::Error>> {
10 initialize(InitializeOptions {
11 product_name: "eos-rs-example".to_string(),
12 product_version: "0.1.0".to_string(),
13 })?;
14
15 let platform = Platform::create(PlatformOptions {
16 product_id: required_env("EOS_PRODUCT_ID")?,
17 sandbox_id: required_env("EOS_SANDBOX_ID")?,
18 deployment_id: required_env("EOS_DEPLOYMENT_ID")?,
19 client_id: required_env("EOS_CLIENT_ID")?,
20 client_secret: required_env("EOS_CLIENT_SECRET")?,
21 is_server: false,
22 encryption_key: None,
23 override_country_code: None,
24 override_locale_code: None,
25 })?;
26
27 // In a real application, call this from your main loop.
28 platform.tick();
29
30 // Optional: access low-level handles for APIs not yet wrapped.
31 let _auth = platform.auth().raw_handle();
32 let _connect = platform.connect().raw_handle();
33 let _lobby = platform.lobby().raw_handle();
34 let _p2p = platform.p2p().raw_handle();
35
36 drop(platform);
37 shutdown()?;
38 println!("eos-rs minimal flow completed.");
39 Ok(())
40}pub fn query_nat_type(&self, cb: impl FnOnce(Result<NatType>) + Send + 'static)
pub fn get_nat_type(&self) -> Result<NatType>
pub fn set_relay_control(&self, relay: RelayControl) -> Result<()>
pub fn get_relay_control(&self) -> Result<RelayControl>
pub fn set_port_range(&self, port: u16, max_additional_ports: u16) -> Result<()>
pub fn get_port_range(&self) -> Result<(u16, u16)>
pub fn set_packet_queue_size( &self, incoming_max: u64, outgoing_max: u64, ) -> Result<()>
pub fn get_packet_queue_info(&self) -> Result<PacketQueueInfo>
pub fn send_packet( &self, local_user: ProductUserId, remote_user: ProductUserId, socket_name: &str, channel: u8, data: &[u8], reliability: PacketReliability, allow_delayed_delivery: bool, disable_auto_accept_connection: bool, ) -> Result<()>
pub fn get_next_received_packet_size( &self, local_user: ProductUserId, requested_channel: Option<u8>, ) -> Result<u32>
pub fn receive_packet( &self, local_user: ProductUserId, max_data_size_bytes: u32, requested_channel: Option<u8>, ) -> Result<ReceivedPacket>
pub fn accept_connection( &self, local_user: ProductUserId, remote_user: ProductUserId, socket_name: &str, ) -> Result<()>
pub fn close_connection( &self, local_user: ProductUserId, remote_user: ProductUserId, socket_name: Option<&str>, ) -> Result<()>
pub fn close_connections( &self, local_user: ProductUserId, socket_name: &str, ) -> Result<()>
pub fn clear_packet_queue( &self, local_user: ProductUserId, remote_user: ProductUserId, socket_name: &str, ) -> Result<()>
Auto Trait Implementations§
impl Freeze for P2P
impl RefUnwindSafe for P2P
impl !Send for P2P
impl !Sync for P2P
impl Unpin for P2P
impl UnsafeUnpin for P2P
impl UnwindSafe for P2P
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