hickory_proto::op

Struct Edns

Source
pub struct Edns { /* private fields */ }
Expand description

Edns implements the higher level concepts for working with extended dns as it is used to create or be created from OPT record data.

Implementations§

Source§

impl Edns

Source

pub fn new() -> Self

Creates a new extended DNS object.

Source

pub fn rcode_high(&self) -> u8

The high order bytes for the response code in the DNS Message

Source

pub fn version(&self) -> u8

Returns the EDNS version

Source

pub fn flags(&self) -> &EdnsFlags

Returns the EdnsFlags portion of EDNS

Source

pub fn flags_mut(&mut self) -> &mut EdnsFlags

Returns a mutable reference to the EdnsFlags

Source

pub fn max_payload(&self) -> u16

Maximum supported size of the DNS payload

Source

pub fn option(&self, code: EdnsCode) -> Option<&EdnsOption>

Returns the Option associated with the code

Source

pub fn options(&self) -> &OPT

Returns the options portion of EDNS

Source

pub fn options_mut(&mut self) -> &mut OPT

Returns a mutable options portion of EDNS

Source

pub fn set_rcode_high(&mut self, rcode_high: u8) -> &mut Self

Set the high order bits for the result code.

Source

pub fn set_version(&mut self, version: u8) -> &mut Self

Set the EDNS version

Source

pub fn enable_dnssec(&mut self)

Available on crate feature dnssec only.

Creates a new extended DNS object prepared for DNSSEC messages.

Source

pub fn set_default_algorithms(&mut self) -> &mut Self

Available on crate feature dnssec only.

Set the default algorithms which are supported by this handle

Set both Algorithms Understood (DAU) and Hash Understood (DHU) to the same algorithms.

Source

pub fn set_dnssec_ok(&mut self, dnssec_ok: bool) -> &mut Self

Set to true if DNSSEC is supported

Source

pub fn set_max_payload(&mut self, max_payload: u16) -> &mut Self

Set the maximum payload which can be supported From RFC 6891: Values lower than 512 MUST be treated as equal to 512

Source

pub fn set_option(&mut self, option: EdnsOption)

👎Deprecated: Please use options_mut().insert() to modify

Set the specified EDNS option

Trait Implementations§

Source§

impl BinEncodable for Edns

Source§

fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>

Write the type to the stream
Source§

fn to_bytes(&self) -> Result<Vec<u8>, ProtoError>

Returns the object in binary form
Source§

impl Clone for Edns

Source§

fn clone(&self) -> Edns

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Edns

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Edns

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Edns

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a Edns> for Record

Source§

fn from(value: &'a Edns) -> Self

This returns a Resource Record that is formatted for Edns(0). Note: the rcode_high value is only part of the rcode, the rest is part of the base

Source§

impl<'a> From<&'a Record> for Edns

Source§

fn from(value: &'a Record) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Edns

Source§

fn eq(&self, other: &Edns) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Edns

Source§

impl StructuralPartialEq for Edns

Auto Trait Implementations§

§

impl Freeze for Edns

§

impl RefUnwindSafe for Edns

§

impl Send for Edns

§

impl Sync for Edns

§

impl Unpin for Edns

§

impl UnwindSafe for Edns

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T