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>
pub fn from_octets(data: Octs) -> Result<Self, LongRecordData>
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.
Trait Implementations§
source§impl<Octs, Other> CanonicalOrd<Null<Other>> for Null<Octs>
impl<Octs, Other> CanonicalOrd<Null<Other>> for Null<Octs>
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>>
impl<'a, Octs> ParseRecordData<'a, Octs> for Null<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>
Parses the record data. Read more
source§impl<Octs, Other> PartialOrd<Null<Other>> for Null<Octs>
impl<Octs, Other> PartialOrd<Null<Other>> for Null<Octs>
source§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> Freeze for Null<Octs>
impl<Octs> RefUnwindSafe for Null<Octs>where
Octs: RefUnwindSafe + ?Sized,
impl<Octs> Send for Null<Octs>
impl<Octs> Sync for Null<Octs>
impl<Octs> Unpin for Null<Octs>
impl<Octs> UnwindSafe for Null<Octs>where
Octs: UnwindSafe + ?Sized,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.