Struct dnssector::question_iterator::QuestionIterator
source · pub struct QuestionIterator<'t> { /* private fields */ }
Implementations
sourceimpl<'t> QuestionIterator<'t>
impl<'t> QuestionIterator<'t>
pub fn new(rr_iterator: RRIterator<'t>) -> Self
Trait Implementations
sourceimpl<'t> DNSIterable for QuestionIterator<'t>
impl<'t> DNSIterable for QuestionIterator<'t>
sourcefn offset(&self) -> Option<usize>
fn offset(&self) -> Option<usize>
Returns the offset of the current RR, or
None
if we haven’t started iterating yet
or if the current record has been deleted. Read moresourcefn offset_next(&self) -> usize
fn offset_next(&self) -> usize
Returns the offset right after the current RR.
sourcefn set_offset(&mut self, offset: usize)
fn set_offset(&mut self, offset: usize)
Sets the offset of the current RR.
sourcefn set_offset_next(&mut self, offset: usize)
fn set_offset_next(&mut self, offset: usize)
Sets the offset of the next RR.
sourcefn invalidate(&mut self)
fn invalidate(&mut self)
Prevents access to the current record.
This is useful after a delete operation: from a user perspective, the current
iterator doesn’t point to a valid RR any more. Read more
sourcefn recompute_rr(&mut self)
fn recompute_rr(&mut self)
Updates the precomputed RR information
sourcefn recompute_sections(&mut self)
fn recompute_sections(&mut self)
Updates the precomputed offsets of each section.
sourcefn parsed_packet(&self) -> &ParsedPacket
fn parsed_packet(&self) -> &ParsedPacket
Accesses the parsed packet structure.
sourcefn parsed_packet_mut(&mut self) -> &mut ParsedPacket
fn parsed_packet_mut(&mut self) -> &mut ParsedPacket
Accesses the parsed packet structure.
sourcefn is_tombstone(&self) -> bool
fn is_tombstone(&self) -> bool
Returns
true
if the record has been invalidated by a previous call to delete()
sourcefn packet(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn packet(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Raw packet data.
sourcefn name_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn name_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Accesses the raw packet data, starting from the name.
sourcefn rdata_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn rdata_slice(&self) -> &[u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Access the raw packet data, starting from right after the name.
sourcefn name_slice_mut(&mut self) -> &mut [u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn name_slice_mut(&mut self) -> &mut [u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Accesses the mutable raw packet data, starting from the name.
sourcefn rdata_slice_mut(&mut self) -> &mut [u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn rdata_slice_mut(&mut self) -> &mut [u8]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Accesses the mutable raw packet data, starting from right after the name.
sourcefn uncompress(&mut self) -> Result<(), Error>
fn uncompress(&mut self) -> Result<(), Error>
Decompresses the whole packet while keeping the iterator available.
sourceimpl<'t> Debug for QuestionIterator<'t>
impl<'t> Debug for QuestionIterator<'t>
sourceimpl<'t> TypedIterable for QuestionIterator<'t>
impl<'t> TypedIterable for QuestionIterator<'t>
sourcefn name(&self) -> Vec<u8>where
Self: DNSIterable,
fn name(&self) -> Vec<u8>where
Self: DNSIterable,
Returns the RR name (labels are dot-delimited), as a byte vector. The name is not supposed to be valid UTF-8. It will be converted to lower-case, though, using traditional DNS conversion rules
sourcefn copy_raw_name(&self, name: &mut Vec<u8>) -> usizewhere
Self: DNSIterable,
fn copy_raw_name(&self, name: &mut Vec<u8>) -> usizewhere
Self: DNSIterable,
Appends the uncompressed RR name (raw format, with labels prefixed by their length) to the given vector.
Returns the length of the uncompressed name. Read more
sourcefn current_section(&self) -> Result<Section, Error>where
Self: DNSIterable,
fn current_section(&self) -> Result<Section, Error>where
Self: DNSIterable,
Returns the section the current record belongs to.
sourcefn resize_rr(&mut self, shift: isize) -> Result<(), Error>where
Self: DNSIterable,
fn resize_rr(&mut self, shift: isize) -> Result<(), Error>where
Self: DNSIterable,
Resizes the current record, by growing or shrinking (with a negative value) the current
record size by
shift
bytes. Read moresourcefn set_raw_name(&mut self, name: &[u8]) -> Result<(), Error>where
Self: DNSIterable,
fn set_raw_name(&mut self, name: &[u8]) -> Result<(), Error>where
Self: DNSIterable,
Changes the name (raw format, untrusted content).
sourcefn rr_type(&self) -> u16where
Self: DNSIterable,
fn rr_type(&self) -> u16where
Self: DNSIterable,
Returns the query type for the current RR.
sourcefn rr_class(&self) -> u16where
Self: DNSIterable,
fn rr_class(&self) -> u16where
Self: DNSIterable,
Returns the query class for the current RR.
Auto Trait Implementations
impl<'t> RefUnwindSafe for QuestionIterator<'t>
impl<'t> Send for QuestionIterator<'t>
impl<'t> Sync for QuestionIterator<'t>
impl<'t> Unpin for QuestionIterator<'t>
impl<'t> !UnwindSafe for QuestionIterator<'t>
Blanket Implementations
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
impl<T> ConvUtil for T
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, DefaultApprox>,
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
type Err = NoError
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.