Struct s2n_quic_core::inet::ipv4::SocketAddressV4
source · [−]#[repr(C)]pub struct SocketAddressV4 { /* private fields */ }Implementations
sourceimpl SocketAddressV4
impl SocketAddressV4
pub const UNSPECIFIED: Self = Self { ip: IpV4Address::UNSPECIFIED, port: U16::ZERO, }
pub const fn ip(&self) -> &IpV4Address
pub fn port(self) -> u16
pub fn set_port(&mut self, port: u16)
pub const fn unicast_scope(&self) -> Option<UnicastScope>
sourcepub const fn to_ipv6_mapped(self) -> SocketAddressV6
pub const fn to_ipv6_mapped(self) -> SocketAddressV6
Converts the IP address into a IPv6 mapped address
Trait Implementations
sourceimpl AsBytes for SocketAddressV4
impl AsBytes for SocketAddressV4
sourcefn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Gets the bytes of this value. Read more
sourcefn as_bytes_mut(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8] where
Self: FromBytes,
fn as_bytes_mut(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8] where
Self: FromBytes,
Gets the bytes of this value mutably. Read more
sourcefn write_to<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self to bytes. Read more
sourcefn write_to_prefix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to_prefix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self to the prefix of bytes. Read more
sourcefn write_to_suffix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
fn write_to_suffix<B>(&self, bytes: B) -> Option<()> where
B: ByteSliceMut,
Writes a copy of self to the suffix of bytes. Read more
sourceimpl Clone for SocketAddressV4
impl Clone for SocketAddressV4
sourcefn clone(&self) -> SocketAddressV4
fn clone(&self) -> SocketAddressV4
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SocketAddressV4
impl Debug for SocketAddressV4
sourceimpl<'a> DecoderValue<'a> for SocketAddressV4
impl<'a> DecoderValue<'a> for SocketAddressV4
fn decode(buffer: DecoderBuffer<'a>) -> DecoderBufferResult<'_, Self>
sourceimpl<'a> DecoderValue<'a> for &'a SocketAddressV4
impl<'a> DecoderValue<'a> for &'a SocketAddressV4
fn decode(buffer: DecoderBuffer<'a>) -> DecoderBufferResult<'_, Self>
sourceimpl<'a> DecoderValueMut<'a> for SocketAddressV4
impl<'a> DecoderValueMut<'a> for SocketAddressV4
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'_, Self>
sourceimpl<'a> DecoderValueMut<'a> for &'a SocketAddressV4
impl<'a> DecoderValueMut<'a> for &'a SocketAddressV4
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'a, Self>
sourceimpl<'a> DecoderValueMut<'a> for &'a mut SocketAddressV4
impl<'a> DecoderValueMut<'a> for &'a mut SocketAddressV4
fn decode_mut(buffer: DecoderBufferMut<'a>) -> DecoderBufferMutResult<'a, Self>
sourceimpl Default for SocketAddressV4
impl Default for SocketAddressV4
sourcefn default() -> SocketAddressV4
fn default() -> SocketAddressV4
Returns the “default value” for a type. Read more
sourceimpl Display for SocketAddressV4
impl Display for SocketAddressV4
sourceimpl EncoderValue for SocketAddressV4
impl EncoderValue for SocketAddressV4
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl<'a> EncoderValue for &'a SocketAddressV4
impl<'a> EncoderValue for &'a SocketAddressV4
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl<'a> EncoderValue for &'a mut SocketAddressV4
impl<'a> EncoderValue for &'a mut SocketAddressV4
sourcefn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Returns the encoding size with no buffer constrains
sourcefn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
fn encoding_size_for_encoder<E: Encoder>(&self, _encoder: &E) -> usize
Returns the encoding size for the given encoder’s capacity
sourcefn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
fn encode_mut<E>(&mut self, encoder: &mut E) where
E: Encoder,
Encodes the value into the encoder, while potentially mutating the value itself
sourceimpl From<&SocketAddressV4> for SocketAddrV4
impl From<&SocketAddressV4> for SocketAddrV4
sourcefn from(address: &SocketAddressV4) -> Self
fn from(address: &SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<&SocketAddressV4> for SocketAddr
impl From<&SocketAddressV4> for SocketAddr
sourcefn from(address: &SocketAddressV4) -> Self
fn from(address: &SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<(Ipv4Addr, u16)> for SocketAddressV4
impl From<(Ipv4Addr, u16)> for SocketAddressV4
sourceimpl From<SocketAddrV4> for SocketAddressV4
impl From<SocketAddrV4> for SocketAddressV4
sourcefn from(address: SocketAddrV4) -> Self
fn from(address: SocketAddrV4) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for SocketAddress
impl From<SocketAddressV4> for SocketAddress
sourcefn from(addr: SocketAddressV4) -> Self
fn from(addr: SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for SocketAddrV4
impl From<SocketAddressV4> for SocketAddrV4
sourcefn from(address: SocketAddressV4) -> Self
fn from(address: SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for SocketAddr
impl From<SocketAddressV4> for SocketAddr
sourcefn from(address: SocketAddressV4) -> Self
fn from(address: SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for LocalAddress
impl From<SocketAddressV4> for LocalAddress
sourcefn from(value: SocketAddressV4) -> Self
fn from(value: SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddressV4> for RemoteAddress
impl From<SocketAddressV4> for RemoteAddress
sourcefn from(value: SocketAddressV4) -> Self
fn from(value: SocketAddressV4) -> Self
Converts to this type from the input type.
sourceimpl FromBytes for SocketAddressV4
impl FromBytes for SocketAddressV4
sourcefn read_from<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self from bytes. Read more
sourcefn read_from_prefix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from_prefix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self from the prefix of bytes. Read more
sourcefn read_from_suffix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
fn read_from_suffix<B>(bytes: B) -> Option<Self> where
B: ByteSlice,
Reads a copy of Self from the suffix of bytes. Read more
sourcefn new_zeroed() -> Self
fn new_zeroed() -> Self
Creates an instance of Self from zeroed bytes.
sourceimpl Hash for SocketAddressV4
impl Hash for SocketAddressV4
sourceimpl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddressV4
impl<'a> IntoEvent<SocketAddress<'a>> for &'a SocketAddressV4
fn into_event(self) -> SocketAddress<'a>
sourceimpl Ord for SocketAddressV4
impl Ord for SocketAddressV4
sourceimpl PartialEq<SocketAddressV4> for SocketAddressV4
impl PartialEq<SocketAddressV4> for SocketAddressV4
sourceimpl PartialOrd<SocketAddressV4> for SocketAddressV4
impl PartialOrd<SocketAddressV4> for SocketAddressV4
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl ToSocketAddrs for SocketAddressV4
impl ToSocketAddrs for SocketAddressV4
type Iter = Once<SocketAddr>
type Iter = Once<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. Read more
sourcefn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved SocketAddrs. Read more
sourceimpl Unspecified for SocketAddressV4
impl Unspecified for SocketAddressV4
sourcefn is_unspecified(&self) -> bool
fn is_unspecified(&self) -> bool
Returns true if the value is unspecified
sourcefn filter_unspecified(self) -> Option<Self>
fn filter_unspecified(self) -> Option<Self>
Coerce a potentially unspecified value into an Option
impl Copy for SocketAddressV4
impl Eq for SocketAddressV4
impl StructuralEq for SocketAddressV4
impl Unaligned for SocketAddressV4
Auto Trait Implementations
impl RefUnwindSafe for SocketAddressV4
impl Send for SocketAddressV4
impl Sync for SocketAddressV4
impl Unpin for SocketAddressV4
impl UnwindSafe for SocketAddressV4
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> PacketPayloadEncoder for T where
T: EncoderValue,
impl<T> PacketPayloadEncoder for T where
T: EncoderValue,
sourcefn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usize where
E: Encoder,
fn encoding_size_hint<E>(&mut self, encoder: &E, minimum_len: usize) -> usize where
E: Encoder,
Returns an estimate of the encoding size of the payload. This may be inaccurate from what actually is encoded. Estimates should be less than or equal to what is actually written. Implementations can return 0 to skip encoding. Read more