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 recordsrr_type
- the record typettl
- 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