Trait dnssector::rr_iterator::DNSIterable
source · pub trait DNSIterable {
Show 19 methods
// Required methods
fn next(self) -> Option<Self>
where Self: Sized;
fn offset(&self) -> Option<usize>;
fn offset_next(&self) -> usize;
fn set_offset(&mut self, offset: usize);
fn set_offset_next(&mut self, offset: usize);
fn invalidate(&mut self);
fn recompute_rr(&mut self);
fn recompute_sections(&mut self);
fn raw(&self) -> RRRaw<'_>;
fn raw_mut(&mut self) -> RRRawMut<'_>;
fn parsed_packet(&self) -> &ParsedPacket;
fn parsed_packet_mut(&mut self) -> &mut ParsedPacket;
// Provided methods
fn is_tombstone(&self) -> bool { ... }
fn packet(&self) -> &[u8] ⓘ { ... }
fn name_slice(&self) -> &[u8] ⓘ { ... }
fn rdata_slice(&self) -> &[u8] ⓘ { ... }
fn name_slice_mut(&mut self) -> &mut [u8] ⓘ { ... }
fn rdata_slice_mut(&mut self) -> &mut [u8] ⓘ { ... }
fn uncompress(&mut self) -> Result<(), Error> { ... }
}
Expand description
The DNSIterable
trait represents a set of records that can be iterated
over.
Required Methods§
sourcefn next(self) -> Option<Self>where
Self: Sized,
fn next(self) -> Option<Self>where Self: Sized,
Returns the next record, or None
if there aren’t any left.
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.
In order to check for the later, please use is_tombstone()
instead for
clarity.
sourcefn 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.
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.
Provided Methods§
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 name_slice(&self) -> &[u8] ⓘ
fn name_slice(&self) -> &[u8] ⓘ
Accesses the raw packet data, starting from the name.
sourcefn rdata_slice(&self) -> &[u8] ⓘ
fn rdata_slice(&self) -> &[u8] ⓘ
Access the raw packet data, starting from right after the name.
sourcefn name_slice_mut(&mut self) -> &mut [u8] ⓘ
fn name_slice_mut(&mut self) -> &mut [u8] ⓘ
Accesses the mutable raw packet data, starting from the name.
sourcefn rdata_slice_mut(&mut self) -> &mut [u8] ⓘ
fn rdata_slice_mut(&mut self) -> &mut [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.