[−][src]Struct enet::Enet
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]
&self,
address: Option<&Address>,
max_peer_count: usize,
max_channel_count: ChannelLimit,
incoming_bandwidth: BandwidthLimit,
outgoing_bandwidth: BandwidthLimit
) -> Result<Host<T>, Error>
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 Peer
s.
Trait Implementations
impl Clone for Enet
[src]
fn clone(&self) -> 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
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,