Enum message_io::network::Transport [−][src]
Enum to identified the underlying transport used.
It can be passed to crate::network::Network::connect()
and
crate::network::Network::listen()
methods to specify the transport used.
Variants
TCP protocol (available through the tcp feature).
As stream protocol, receiving a message from TCP do not imply to read
the entire message.
If you want a packet based way to send over TCP, use FramedTcp
instead.
Like TCP, but encoded with a slim frame layer to manage the data as a packet,
instead of as a stream (available through the tcp feature).
Most of the time you would want to use this instead of the raw Tcp
.
UDP protocol (available through the udp feature).
Take into account that UDP is not connection oriented and a packet can be lost
or received disordered.
If it is specified in the listener and the address is a Ipv4 in the range of multicast ips
(from 224.0.0.0
to 239.255.255.255
), the listener will be configured in multicast mode.
WebSocket protocol (available through the websocket feature).
If you use a crate::network::RemoteAddr::Url
in the connect()
method,
you can specify wss
of ws
schemas to connect with or without security.
If you use a crate::network::RemoteAddr::SocketAddr
the socket will be a normal
websocket with the following uri: ws://{SocketAddr}/message-io-default
.
Implementations
impl Transport
[src]
pub fn mount_adapter(self, launcher: &mut AdapterLauncher)
[src]
Associates an adapter.
This method mounts the adapter to be used in the Network
.
pub const fn max_message_size(self) -> usize
[src]
Max packet payload size available for each transport. If the protocol is not packet-based (e.g. TCP, that is a stream), the returned value correspond with the maximum bytes that can produce a read event.
pub const fn is_connection_oriented(self) -> bool
[src]
Tell if the transport protocol is a connection oriented protocol.
If it is, Connection
and Disconnection
events will be generated.
pub const fn is_packet_based(self) -> bool
[src]
Tell if the transport protocol is a packet based protocol. It implies that any send call corresponds to a data message event. The opossite of a packet based is a stream based transport (e.g Tcp). In this case, reading a data message event do not imply reading the entire message sent. It is in change of the user to determinate how to read the data.
pub fn id(self) -> u8
[src]
Returns the adapter id used for this transport. It is equivalent to the position of the enum starting by 0
Trait Implementations
impl Clone for Transport
[src]
impl Copy for Transport
[src]
impl Debug for Transport
[src]
impl Display for Transport
[src]
impl Eq for Transport
[src]
impl Hash for Transport
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl IntoEnumIterator for Transport
[src]
impl PartialEq<Transport> for Transport
[src]
fn eq(&self, other: &Transport) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Transport
[src]
impl StructuralPartialEq for Transport
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnwindSafe for Transport
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,