Trait trust_dns_proto::rr::RecordData
source · pub trait RecordData: Clone + Sized + PartialEq + Eq + Display + 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;
}
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
Object Safety§
This trait is not object safe.