Struct trust_dns_proto::rr::rdata::opt::ClientSubnet
source · pub struct ClientSubnet { /* private fields */ }
Expand description
RFC 7871, Client Subnet, Optional
+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ 0: | FAMILY | +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ 2: | SOURCE PREFIX-LENGTH | SCOPE PREFIX-LENGTH | +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ 4: | ADDRESS… / +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+
o FAMILY, 2 octets, indicates the family of the address contained in the option, using address family codes as assigned by IANA in Address Family Numbers [Address_Family_Numbers]. o SOURCE PREFIX-LENGTH, an unsigned octet representing the leftmost number of significant bits of ADDRESS to be used for the lookup. In responses, it mirrors the same value as in the queries. o SCOPE PREFIX-LENGTH, an unsigned octet representing the leftmost number of significant bits of ADDRESS that the response covers. In queries, it MUST be set to 0. o ADDRESS, variable number of octets, contains either an IPv4 or IPv6 address, depending on FAMILY, which MUST be truncated to the number of bits indicated by the SOURCE PREFIX-LENGTH field, padding with 0 bits to pad to the end of the last octet needed. o A server receiving an ECS option that uses either too few or too many ADDRESS octets, or that has non-zero ADDRESS bits set beyond SOURCE PREFIX-LENGTH, SHOULD return FORMERR to reject the packet, as a signal to the software developer making the request to fix their implementation.
Implementations§
Trait Implementations§
source§impl<'a> BinDecodable<'a> for ClientSubnet
impl<'a> BinDecodable<'a> for ClientSubnet
source§fn read(decoder: &mut BinDecoder<'a>) -> ProtoResult<Self>
fn read(decoder: &mut BinDecoder<'a>) -> ProtoResult<Self>
source§fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
source§impl BinEncodable for ClientSubnet
impl BinEncodable for ClientSubnet
source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
source§impl Clone for ClientSubnet
impl Clone for ClientSubnet
source§fn clone(&self) -> ClientSubnet
fn clone(&self) -> ClientSubnet
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ClientSubnet
impl Debug for ClientSubnet
source§impl<'de> Deserialize<'de> for ClientSubnet
impl<'de> Deserialize<'de> for ClientSubnet
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl From<IpNet> for ClientSubnet
impl From<IpNet> for ClientSubnet
source§impl FromStr for ClientSubnet
impl FromStr for ClientSubnet
source§impl Hash for ClientSubnet
impl Hash for ClientSubnet
source§impl PartialEq for ClientSubnet
impl PartialEq for ClientSubnet
source§fn eq(&self, other: &ClientSubnet) -> bool
fn eq(&self, other: &ClientSubnet) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ClientSubnet
impl PartialOrd for ClientSubnet
source§fn partial_cmp(&self, other: &ClientSubnet) -> Option<Ordering>
fn partial_cmp(&self, other: &ClientSubnet) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ClientSubnet
impl Serialize for ClientSubnet
source§impl<'a> TryFrom<&'a [u8]> for ClientSubnet
impl<'a> TryFrom<&'a [u8]> for ClientSubnet
source§impl<'a> TryFrom<&'a ClientSubnet> for Vec<u8>
impl<'a> TryFrom<&'a ClientSubnet> for Vec<u8>
§type Error = ProtoError
type Error = ProtoError
impl Copy for ClientSubnet
impl Eq for ClientSubnet
impl StructuralEq for ClientSubnet
impl StructuralPartialEq for ClientSubnet
Auto Trait Implementations§
impl RefUnwindSafe for ClientSubnet
impl Send for ClientSubnet
impl Sync for ClientSubnet
impl Unpin for ClientSubnet
impl UnwindSafe for ClientSubnet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.