[][src]Struct enet::Enet

pub struct Enet { /* fields omitted */ }

Main API entry point. Provides methods such as host and peer creation.

Creating an instance of this struct for the first time (using new()) will initialize ENet. Further attempts to create instances will result in errors, so it can only be constructed once (but it can be cloned).

This struct can be used to performs most top-level ENet functionality, such as host creation and connection establishment.

Methods

impl Enet[src]

pub fn new() -> Result<Enet, InitializationError>[src]

Initializes ENet and returns a handle to the top-level functionality, in the form of an Enet-instance.

pub fn create_host<T>(
    &self,
    address: Option<&Address>,
    max_peer_count: usize,
    max_channel_count: ChannelLimit,
    incoming_bandwidth: BandwidthLimit,
    outgoing_bandwidth: BandwidthLimit
) -> Result<Host<T>, Error>
[src]

Creates a Host. A Host is an endpoint of an ENet connection. For more information consult the official ENet-documentation.

address specifies the address to listen on. Client-only endpoints can choose None. max_channel_count will be set to its (ENet-specified) default value if None.

The type T specifies the data associated with corresponding Peers.

Trait Implementations

impl Clone for Enet[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Enet[src]

Auto Trait Implementations

impl Send for Enet

impl Sync for Enet

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]