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§

source

fn next(self) -> Option<Self>where Self: Sized,

Returns the next record, or None if there aren’t any left.

source

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.

source

fn offset_next(&self) -> usize

Returns the offset right after the current RR.

source

fn set_offset(&mut self, offset: usize)

Sets the offset of the current RR.

source

fn set_offset_next(&mut self, offset: usize)

Sets the offset of the next RR.

source

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.

source

fn recompute_rr(&mut self)

Updates the precomputed RR information

source

fn recompute_sections(&mut self)

Updates the precomputed offsets of each section.

source

fn raw(&self) -> RRRaw<'_>

Accesses the raw packet data.

source

fn raw_mut(&mut self) -> RRRawMut<'_>

Accesses the mutable raw packet data.

source

fn parsed_packet(&self) -> &ParsedPacket

Accesses the parsed packet structure.

source

fn parsed_packet_mut(&mut self) -> &mut ParsedPacket

Accesses the parsed packet structure.

Provided Methods§

source

fn is_tombstone(&self) -> bool

Returns true if the record has been invalidated by a previous call to delete()

source

fn packet(&self) -> &[u8]

Raw packet data.

source

fn name_slice(&self) -> &[u8]

Accesses the raw packet data, starting from the name.

source

fn rdata_slice(&self) -> &[u8]

Access the raw packet data, starting from right after the name.

source

fn name_slice_mut(&mut self) -> &mut [u8]

Accesses the mutable raw packet data, starting from the name.

source

fn rdata_slice_mut(&mut self) -> &mut [u8]

Accesses the mutable raw packet data, starting from right after the name.

source

fn uncompress(&mut self) -> Result<(), Error>

Decompresses the whole packet while keeping the iterator available.

Implementors§