Struct hickory_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§
source§impl ClientSubnet
impl ClientSubnet
sourcepub fn new(address: IpAddr, source_prefix: u8, scope_prefix: u8) -> Self
pub fn new(address: IpAddr, source_prefix: u8, scope_prefix: u8) -> Self
Construct a new EcsOption with the address, source_prefix and scope_prefix.
sourcepub fn source_prefix(&self) -> u8
pub fn source_prefix(&self) -> u8
returns the source prefix
sourcepub fn set_source_prefix(&mut self, source_prefix: u8)
pub fn set_source_prefix(&mut self, source_prefix: u8)
returns the source prefix
sourcepub fn scope_prefix(&self) -> u8
pub fn scope_prefix(&self) -> u8
returns the scope prefix
sourcepub fn set_scope_prefix(&mut self, scope_prefix: u8)
pub fn set_scope_prefix(&mut self, scope_prefix: u8)
returns the scope prefix
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>
Read the type from the stream
source§fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
Returns the object in binary form
source§impl BinEncodable for ClientSubnet
impl BinEncodable for ClientSubnet
source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
Write the type to the stream
source§impl Clone for ClientSubnet
impl Clone for ClientSubnet
source§fn clone(&self) -> ClientSubnet
fn clone(&self) -> ClientSubnet
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 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>,
Deserialize this value from the given Serde deserializer. Read more
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§impl PartialOrd for ClientSubnet
impl PartialOrd for ClientSubnet
source§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
The type returned in the event of a conversion error.
impl Copy for ClientSubnet
impl Eq for ClientSubnet
impl StructuralPartialEq for ClientSubnet
Auto Trait Implementations§
impl Freeze for ClientSubnet
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.