Struct domain::base::rdata::UnknownRecordData
source · pub struct UnknownRecordData<Octs> { /* private fields */ }
Expand description
A type for parsing any type of record data.
This type accepts any record type and stores the plain, unparsed record data as an octets sequence.
Because some record types allow compressed domain names in their record data, this type cannot be used safely with these record types. For these record types, the structure of the content needs to be known.
RFC 3597 limits the types for which compressed names are allowed in the
record data to those defined in RFC 1035 itself. Specific types for all
these record types exist in
domain::rdata::rfc1035
.
Ultimately, you should only use this type for record types for which there
is no implementation available in this crate. The two types
AllRecordData
and ZoneRecordData
provide a convenient way to
always use the correct record data type.
Implementations§
source§impl<Octs> UnknownRecordData<Octs>
impl<Octs> UnknownRecordData<Octs>
sourcepub fn from_octets(rtype: Rtype, data: Octs) -> Result<Self, LongRecordData>
pub fn from_octets(rtype: Rtype, data: Octs) -> Result<Self, LongRecordData>
Creates generic record data from a bytes value contain the data.
sourcepub fn scan<S: Scanner<Octets = Octs>>(
rtype: Rtype,
scanner: &mut S,
) -> Result<Self, S::Error>
pub fn scan<S: Scanner<Octets = Octs>>( rtype: Rtype, scanner: &mut S, ) -> Result<Self, S::Error>
Scans the record data.
This isn’t implemented via Scan
, because we need the record type.
sourcepub fn scan_without_marker<S: Scanner<Octets = Octs>>(
rtype: Rtype,
scanner: &mut S,
) -> Result<Self, S::Error>
pub fn scan_without_marker<S: Scanner<Octets = Octs>>( rtype: Rtype, scanner: &mut S, ) -> Result<Self, S::Error>
Scans the record data assuming that the marker has been skipped.
sourcepub fn parse_any_rdata<'a, SrcOcts>(
rtype: Rtype,
parser: &mut Parser<'a, SrcOcts>,
) -> Result<Self, ParseError>
pub fn parse_any_rdata<'a, SrcOcts>( rtype: Rtype, parser: &mut Parser<'a, SrcOcts>, ) -> Result<Self, ParseError>
Parses any record type as unknown record data.
This is an associated function rather than an impl of
ParseAnyRecordData
because some record types must not be parsed
as unknown data as they can contain compressed domain names.
Trait Implementations§
source§impl<Octs, Other> CanonicalOrd<UnknownRecordData<Other>> for UnknownRecordData<Octs>
impl<Octs, Other> CanonicalOrd<UnknownRecordData<Other>> for UnknownRecordData<Octs>
source§fn canonical_cmp(&self, other: &UnknownRecordData<Other>) -> Ordering
fn canonical_cmp(&self, other: &UnknownRecordData<Other>) -> Ordering
self
and other
.source§fn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
self
is canonically less than other
.source§fn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
self
is canonically less than or equal to other
.source§fn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
self
is canonically greater than other
.source§fn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
self
is canonically greater than or equal to other
.source§impl<Octs: Clone> Clone for UnknownRecordData<Octs>
impl<Octs: Clone> Clone for UnknownRecordData<Octs>
source§fn clone(&self) -> UnknownRecordData<Octs>
fn clone(&self) -> UnknownRecordData<Octs>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Octs: AsRef<[u8]>> ComposeRecordData for UnknownRecordData<Octs>
impl<Octs: AsRef<[u8]>> ComposeRecordData for UnknownRecordData<Octs>
source§fn rdlen(&self, _compress: bool) -> Option<u16>
fn rdlen(&self, _compress: bool) -> Option<u16>
source§fn compose_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
target
.source§fn compose_canonical_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
target
.source§fn compose_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§fn compose_canonical_len_rdata<Target: Composer + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_canonical_len_rdata<Target: Composer + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§impl<O, N> From<UnknownRecordData<O>> for AllRecordData<O, N>
impl<O, N> From<UnknownRecordData<O>> for AllRecordData<O, N>
source§fn from(value: UnknownRecordData<O>) -> Self
fn from(value: UnknownRecordData<O>) -> Self
source§impl<O, N> From<UnknownRecordData<O>> for ZoneRecordData<O, N>
impl<O, N> From<UnknownRecordData<O>> for ZoneRecordData<O, N>
source§fn from(value: UnknownRecordData<O>) -> Self
fn from(value: UnknownRecordData<O>) -> Self
source§impl<Octs, SrcOcts> OctetsFrom<UnknownRecordData<SrcOcts>> for UnknownRecordData<Octs>where
Octs: OctetsFrom<SrcOcts>,
impl<Octs, SrcOcts> OctetsFrom<UnknownRecordData<SrcOcts>> for UnknownRecordData<Octs>where
Octs: OctetsFrom<SrcOcts>,
type Error = <Octs as OctetsFrom<SrcOcts>>::Error
source§fn try_octets_from(
source: UnknownRecordData<SrcOcts>,
) -> Result<Self, Self::Error>
fn try_octets_from( source: UnknownRecordData<SrcOcts>, ) -> Result<Self, Self::Error>
source§impl<Octs: AsRef<[u8]>> Ord for UnknownRecordData<Octs>
impl<Octs: AsRef<[u8]>> Ord for UnknownRecordData<Octs>
source§impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for UnknownRecordData<Octs::Range<'a>>
impl<'a, Octs: Octets + ?Sized> ParseRecordData<'a, Octs> for UnknownRecordData<Octs::Range<'a>>
source§fn parse_rdata(
rtype: Rtype,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_rdata( rtype: Rtype, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
source§impl<Octs, Other> PartialEq<UnknownRecordData<Other>> for UnknownRecordData<Octs>
impl<Octs, Other> PartialEq<UnknownRecordData<Other>> for UnknownRecordData<Octs>
source§impl<Octs, Other> PartialOrd<UnknownRecordData<Other>> for UnknownRecordData<Octs>
impl<Octs, Other> PartialOrd<UnknownRecordData<Other>> for UnknownRecordData<Octs>
source§impl<Octs: AsRef<[u8]>> RecordData for UnknownRecordData<Octs>
impl<Octs: AsRef<[u8]>> RecordData for UnknownRecordData<Octs>
impl<Octs: AsRef<[u8]>> Eq for UnknownRecordData<Octs>
Auto Trait Implementations§
impl<Octs> Freeze for UnknownRecordData<Octs>where
Octs: Freeze,
impl<Octs> RefUnwindSafe for UnknownRecordData<Octs>where
Octs: RefUnwindSafe,
impl<Octs> Send for UnknownRecordData<Octs>where
Octs: Send,
impl<Octs> Sync for UnknownRecordData<Octs>where
Octs: Sync,
impl<Octs> Unpin for UnknownRecordData<Octs>where
Octs: Unpin,
impl<Octs> UnwindSafe for UnknownRecordData<Octs>where
Octs: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)