pub struct Null<Octs: ?Sized> { /* private fields */ }
Expand description
Null record data.
Null records can contain whatever data. They are experimental and not allowed in zone files.
The Null record type is defined in RFC 1035, section 3.3.10.
Implementations§
source§impl<Octs> Null<Octs>
impl<Octs> Null<Octs>
sourcepub fn from_octets(data: Octs) -> Result<Self, LongRecordData>where
Octs: AsRef<[u8]>,
pub fn from_octets(data: Octs) -> Result<Self, LongRecordData>where Octs: AsRef<[u8]>,
Creates new NULL record data from the given octets.
The function will fail if data
is longer than 65,535 octets.
sourcepub unsafe fn from_octets_unchecked(data: Octs) -> Self
pub unsafe fn from_octets_unchecked(data: Octs) -> Self
Creates new NULL record data without checking.
Safety
The caller has to ensure that data
is at most 65,535 octets long.
source§impl Null<[u8]>
impl Null<[u8]>
sourcepub fn from_slice(data: &[u8]) -> Result<&Self, LongRecordData>
pub fn from_slice(data: &[u8]) -> Result<&Self, LongRecordData>
Creates new NULL record data from an octets slice.
The function will fail if data
is longer than 65,535 octets.
sourcepub unsafe fn from_slice_unchecked(data: &[u8]) -> &Self
pub unsafe fn from_slice_unchecked(data: &[u8]) -> &Self
Creates new NULL record from an octets slice data without checking.
Safety
The caller has to ensure that data
is at most 65,535 octets long.
source§impl<SrcOcts> Null<SrcOcts>
impl<SrcOcts> Null<SrcOcts>
pub fn flatten_into<Octs>(self) -> Result<Null<Octs>, PushError>where Octs: OctetsFrom<SrcOcts>,
Trait Implementations§
source§impl<Octs, Other> CanonicalOrd<Null<Other>> for Null<Octs>where
Octs: AsRef<[u8]> + ?Sized,
Other: AsRef<[u8]> + ?Sized,
impl<Octs, Other> CanonicalOrd<Null<Other>> for Null<Octs>where Octs: AsRef<[u8]> + ?Sized, Other: AsRef<[u8]> + ?Sized,
source§fn canonical_cmp(&self, other: &Null<Other>) -> Ordering
fn canonical_cmp(&self, other: &Null<Other>) -> Ordering
Returns the canonical ordering between
self
and other
.source§fn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
Returns whether
self
is canonically less than other
.source§fn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
Returns whether
self
is canonically less than or equal to other
.source§fn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
Returns whether
self
is canonically greater than other
.source§fn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
Returns whether
self
is canonically greater than or equal to other
.source§impl<Octs: AsRef<[u8]> + ?Sized> ComposeRecordData for Null<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> ComposeRecordData for Null<Octs>
source§fn rdlen(&self, _compress: bool) -> Option<u16>
fn rdlen(&self, _compress: bool) -> Option<u16>
Returns the length of the record data if available. Read more
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>
Appends the wire format of the record data into
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>
Appends the canonical wire format of the record data into
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>
Appends the record data prefixed with its length.
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>
Appends the record data prefixed with its length.
source§impl<O, N> From<Null<O>> for AllRecordData<O, N>
impl<O, N> From<Null<O>> for AllRecordData<O, N>
source§impl<Octs, SrcOcts> OctetsFrom<Null<SrcOcts>> for Null<Octs>where
Octs: OctetsFrom<SrcOcts>,
impl<Octs, SrcOcts> OctetsFrom<Null<SrcOcts>> for Null<Octs>where Octs: OctetsFrom<SrcOcts>,
type Error = <Octs as OctetsFrom<SrcOcts>>::Error
source§impl<'a, Octs> ParseRecordData<'a, Octs> for Null<Octs::Range<'a>>where
Octs: Octets + ?Sized,
impl<'a, Octs> ParseRecordData<'a, Octs> for Null<Octs::Range<'a>>where Octs: Octets + ?Sized,
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>
Parses the record data. Read more
source§impl<Octs, Other> PartialEq<Null<Other>> for Null<Octs>where
Octs: AsRef<[u8]> + ?Sized,
Other: AsRef<[u8]> + ?Sized,
impl<Octs, Other> PartialEq<Null<Other>> for Null<Octs>where Octs: AsRef<[u8]> + ?Sized, Other: AsRef<[u8]> + ?Sized,
source§impl<Octs, Other> PartialOrd<Null<Other>> for Null<Octs>where
Octs: AsRef<[u8]> + ?Sized,
Other: AsRef<[u8]> + ?Sized,
impl<Octs, Other> PartialOrd<Null<Other>> for Null<Octs>where Octs: AsRef<[u8]> + ?Sized, Other: AsRef<[u8]> + ?Sized,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<Octs: ?Sized> RecordData for Null<Octs>
impl<Octs: ?Sized> RecordData for Null<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> Eq for Null<Octs>
Auto Trait Implementations§
impl<Octs: ?Sized> RefUnwindSafe for Null<Octs>where Octs: RefUnwindSafe,
impl<Octs: ?Sized> Send for Null<Octs>where Octs: Send,
impl<Octs: ?Sized> Sync for Null<Octs>where Octs: Sync,
impl<Octs: ?Sized> Unpin for Null<Octs>where Octs: Unpin,
impl<Octs: ?Sized> UnwindSafe for Null<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
Mutably borrows from an owned value. Read more
source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere Self::Error: Into<Infallible>,
Performs an infallible conversion.