#[repr(u32)]
pub enum DatagramSocketProtocol {
Udp,
IcmpEcho,
}
Expand description
Protocols supported by [fuchsia.posix.socket/DatagramSocket
].
DatagramSocketProtocol
enumerates the protocols supported by the network
stack over datagram sockets.
Variants§
Udp
UDP (User Datagram Protocol).
A UDP socket is equivalent to the POSIX API of SOCK_DGRAM
with a
protocol of 0 or IPPROTO_UDP
.
IcmpEcho
ICMP (Internet Control Message Protocol) echo.
An ICMP echo socket is equivalent to the POSIX API of SOCK_DGRAM
with
a protocol of IPPROTO_ICMP
IPPROTO_ICMPV6
(depending on provided
domain).
Datagrams sent over an ICMP echo socket must have a valid ICMP or ICMPv6 echo header.
Implementations§
source§impl DatagramSocketProtocol
impl DatagramSocketProtocol
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
👎Deprecated: Strict enums should not use
is_unknown
Trait Implementations§
source§impl Clone for DatagramSocketProtocol
impl Clone for DatagramSocketProtocol
source§fn clone(&self) -> DatagramSocketProtocol
fn clone(&self) -> DatagramSocketProtocol
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DatagramSocketProtocol
impl Debug for DatagramSocketProtocol
source§impl Decodable for DatagramSocketProtocol
impl Decodable for DatagramSocketProtocol
source§fn decode(
&mut self,
decoder: &mut Decoder<'_>,
offset: usize
) -> Result<(), Error>
fn decode( &mut self, decoder: &mut Decoder<'_>, offset: usize ) -> Result<(), Error>
Decodes an object of this type from the decoder’s buffers into
self
.
Callers must ensure that offset
is a multiple of
Layout::inline_align
, and that decoder.buf
has room for reading
Layout::inline_size
bytes at offset
. Read moresource§impl Encodable for DatagramSocketProtocol
impl Encodable for DatagramSocketProtocol
source§fn encode(
&mut self,
encoder: &mut Encoder<'_, '_>,
offset: usize,
recursion_depth: usize
) -> Result<(), Error>
fn encode( &mut self, encoder: &mut Encoder<'_, '_>, offset: usize, recursion_depth: usize ) -> Result<(), Error>
Encode the object into the buffer. Any handles stored in the object are
swapped for
Handle::INVALID
. Callers must ensure that offset
is a
multiple of Layout::inline_align
, and that encoder.buf
has room for
writing Layout::inline_size
bytes at offset
. Read moresource§impl Hash for DatagramSocketProtocol
impl Hash for DatagramSocketProtocol
source§impl Layout for DatagramSocketProtocol
impl Layout for DatagramSocketProtocol
source§fn inline_align(context: &Context) -> usize
fn inline_align(context: &Context) -> usize
Returns the minimum required alignment of the inline portion of the
encoded object. It must be a (nonzero) power of two.
source§fn inline_size(context: &Context) -> usize
fn inline_size(context: &Context) -> usize
Returns the size of the inline portion of the encoded object, including
padding for the type’s alignment. Must be a multiple of
inline_align
.§fn supports_simple_copy() -> boolwhere
Self: Sized,
fn supports_simple_copy() -> boolwhere Self: Sized,
Returns true iff the type can be encoded or decoded via simple copy. Read more
source§impl Ord for DatagramSocketProtocol
impl Ord for DatagramSocketProtocol
source§fn cmp(&self, other: &DatagramSocketProtocol) -> Ordering
fn cmp(&self, other: &DatagramSocketProtocol) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<DatagramSocketProtocol> for DatagramSocketProtocol
impl PartialEq<DatagramSocketProtocol> for DatagramSocketProtocol
source§fn eq(&self, other: &DatagramSocketProtocol) -> bool
fn eq(&self, other: &DatagramSocketProtocol) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<DatagramSocketProtocol> for DatagramSocketProtocol
impl PartialOrd<DatagramSocketProtocol> for DatagramSocketProtocol
source§fn partial_cmp(&self, other: &DatagramSocketProtocol) -> Option<Ordering>
fn partial_cmp(&self, other: &DatagramSocketProtocol) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DatagramSocketProtocol
impl Eq for DatagramSocketProtocol
impl StructuralEq for DatagramSocketProtocol
impl StructuralPartialEq for DatagramSocketProtocol
Auto Trait Implementations§
impl RefUnwindSafe for DatagramSocketProtocol
impl Send for DatagramSocketProtocol
impl Sync for DatagramSocketProtocol
impl Unpin for DatagramSocketProtocol
impl UnwindSafe for DatagramSocketProtocol
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> LayoutObject for Twhere
T: Layout,
impl<T> LayoutObject for Twhere T: Layout,
§fn inline_align(&self, context: &Context) -> usize
fn inline_align(&self, context: &Context) -> usize
See
Layout::inline_align
.§fn inline_size(&self, context: &Context) -> usize
fn inline_size(&self, context: &Context) -> usize
See
Layout::inline_size
.