Struct trust_dns::rr::resource::Record [] [src]

pub struct Record {
    // some fields omitted
}

Methods

impl Record

fn new() -> Record

Creates a default record, use the setters to build a more useful object.

There are no optional elements in this object, defaults are an empty name, type A, class IN, ttl of 0 and the 0.0.0.0 ip address.

fn with(name: Name, rr_type: RecordType, ttl: u32) -> Record

Create a record with the specified initial values.

Arguments

  • name - name of the resource records
  • rr_type - the record type
  • ttl - time-to-live is the amount of time this record should be cached before refreshing

fn name(&mut self, name: Name) -> &mut Self

fn add_name(&mut self, label: String) -> &mut Self

fn rr_type(&mut self, rr_type: RecordType) -> &mut Self

fn dns_class(&mut self, dns_class: DNSClass) -> &mut Self

fn ttl(&mut self, ttl: u32) -> &mut Self

fn rdata(&mut self, rdata: RData) -> &mut Self

fn get_name(&self) -> &Name

fn get_rr_type(&self) -> RecordType

fn get_dns_class(&self) -> DNSClass

fn get_ttl(&self) -> u32

fn get_rdata(&self) -> &RData

fn get_rdata_mut(&mut self) -> &mut RData

Trait Implementations

impl BinSerializable<Record> for Record

fn read(decoder: &mut BinDecoder) -> DecodeResult<Record>

fn emit(&self, encoder: &mut BinEncoder) -> EncodeResult

impl PartialEq for Record

RFC 2136 DNS Update April 1997

1.1.1. Two RRs are considered equal if their NAME, CLASS, TYPE, RDLENGTH and RDATA fields are equal. Note that the time-to-live (TTL) field is explicitly excluded from the comparison.

1.1.2. The rules for comparison of character strings in names are specified in [RFC1035 2.3.3]. i.e. case insensitive

fn eq(&self, other: &Self) -> bool

fn ne(&self, other: &Self) -> bool

impl PartialOrd<Record> for Record

fn partial_cmp(&self, other: &Record) -> Option<Ordering>

1.0.0fn lt(&self, other: &Rhs) -> bool

1.0.0fn le(&self, other: &Rhs) -> bool

1.0.0fn gt(&self, other: &Rhs) -> bool

1.0.0fn ge(&self, other: &Rhs) -> bool

impl<'a> From<&'a Edns> for Record

fn from(value: &'a Edns) -> Record

Derived Implementations

impl Clone for Record

fn clone(&self) -> Record

1.0.0fn clone_from(&mut self, source: &Self)

impl Debug for Record

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Ord for Record

fn cmp(&self, __arg_0: &Record) -> Ordering

impl Eq for Record