pub trait RecordData:
Clone
+ Sized
+ PartialEq
+ Eq
+ Display
+ Debug
+ BinEncodable {
// Required methods
fn try_from_rdata(data: RData) -> Result<Self, RData>;
fn try_borrow(data: &RData) -> Option<&Self>;
fn record_type(&self) -> RecordType;
fn into_rdata(self) -> RData;
// Provided method
fn is_update(&self) -> bool { ... }
}
Expand description
RecordData that is stored in a DNS Record.
This trait allows for generic usage of RecordData
types inside the Record
type. Specific RecordData types can be used to enforce compile time constraints on a Record.
Required Methods§
Sourcefn try_from_rdata(data: RData) -> Result<Self, RData>
fn try_from_rdata(data: RData) -> Result<Self, RData>
Attempts to convert to this RecordData from the RData type, if it is not the correct type the original is returned
Sourcefn try_borrow(data: &RData) -> Option<&Self>
fn try_borrow(data: &RData) -> Option<&Self>
Attempts to borrow this RecordData from the RData type, if it is not the correct type the original is returned
Sourcefn record_type(&self) -> RecordType
fn record_type(&self) -> RecordType
Get the associated RecordType for the RecordData
Sourcefn into_rdata(self) -> RData
fn into_rdata(self) -> RData
Converts this RecordData into generic RecordData
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl RecordData for RData
impl RecordData for CDNSKEY
Available on crate feature
dnssec
only.impl RecordData for CDS
Available on crate feature
dnssec
only.impl RecordData for DNSKEY
Available on crate feature
dnssec
only.impl RecordData for DS
Available on crate feature
dnssec
only.impl RecordData for KEY
Available on crate feature
dnssec
only.impl RecordData for NSEC3
Available on crate feature
dnssec
only.impl RecordData for NSEC3PARAM
Available on crate feature
dnssec
only.impl RecordData for NSEC
Available on crate feature
dnssec
only.impl RecordData for RRSIG
Available on crate feature
dnssec
only.impl RecordData for SIG
Available on crate feature
dnssec
only.impl RecordData for TSIG
Available on crate feature
dnssec
only.