#[repr(i32)]
#[non_exhaustive]
pub enum SockType {
Stream,
Datagram,
SeqPacket,
Raw,
Rdm,
}
Expand description
These constants are used to specify the communication semantics
when creating a socket with socket()
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Stream
Provides sequenced, reliable, two-way, connection- based byte streams. An out-of-band data transmission mechanism may be supported.
Datagram
Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
SeqPacket
Provides a sequenced, reliable, two-way connection- based data transmission path for datagrams of fixed maximum length; a consumer is required to read an entire packet with each input system call.
Raw
Provides raw network protocol access.
Rdm
Provides a reliable datagram layer that does not guarantee ordering.