[−][src]Struct toluol::DnsRecord
Represents a DNS record, i. e. an entry in the answer, authority or additional section of a DNS
message.
class
and ttl
are None
iff atype == DnsType::OPT
. payload_size
, rcode
,
edns_version
and flags
are None
iff atype != DnsType::OPT
.
See RFC 1035 for further information.
Implementations
impl DnsRecord
[src]
pub fn new_opt_record(payload_size: u16, do_flag: bool) -> DnsRecord
[src]
Creates a new OPT record.
pub fn encode(&self) -> Result<Vec<u8>>
[src]
Encodes a DnsRecord as a series of bytes.
Returns an error if a method defined in byteorder::WriteBytesExt
returns an error.
pub fn parse(msg: &mut Cursor<&[u8]>, rcode: DnsRcode) -> Result<DnsRecord>
[src]
Parses an encoded DnsRecord from a series of bytes.
Returns an error if DnsMessage::parse_qname()
, DnsType::parse()
, DnsClass::parse()
,
DnsRecord::parse_rdata()
or a method defined in byteorder::ReadBytesExt
return an error
or an OPT record has a name other than ""
.
pub fn parse_rdata(
atype: &DnsType,
msg: &mut Cursor<&[u8]>,
rdlength: u16
) -> Result<Vec<String>>
[src]
atype: &DnsType,
msg: &mut Cursor<&[u8]>,
rdlength: u16
) -> Result<Vec<String>>
Parses encoded rdata into a vector of strings (canonical format).
atype
is the type of the record containing the rdata. msg
is the complete response
message, which is needed for message compression. rdlength
is the length of the RDATA in
bytes.
Returns an error if DnsMessage::parse_qname()
, DnsMessage::parse_string()
, DnsType::parse()
,
DnsClass::parse()
, DnsRecord::parse_rdata()
, DnsRecord::parse_nsec_type_bitmap()
,
DnsRecord::interpret_nsec_type_bitmap()
or a method defined in byteorder::ReadBytesExt
return an error or a TXT record contains an invalid byte.
pub fn interpret_dnssec_algorithm(algorithm: u8) -> Result<String>
[src]
Interprets a DNSSEC algorithm number and returns a describing string.
pub fn interpret_nsec_type_bitmap(types: Vec<u16>) -> Result<String>
[src]
Takes a list of DNS TYPEs (e. g. the return value of DnsRecord::parse_nsec_type_bitmap()
)
and returns a string containing the representation of the listed TYPEs.
Returns an error if DnsType::parse()
returns an error (i. e. types
contains an invalid
or unimplemented type).
pub fn parse_nsec_type_bitmap(
msg: &mut Cursor<&[u8]>,
len_read: u16,
rdlength: u16
) -> Result<Vec<u16>>
[src]
msg: &mut Cursor<&[u8]>,
len_read: u16,
rdlength: u16
) -> Result<Vec<u16>>
Parses the type bitmap in the RDATA section of an NSEC or NSEC3 record.
len_read
is the count of the bytes already read from the rdata. rdlength
is the
total length of the rdata.
Returns an error if a method defined in byteorder::ReadBytesExt
returns an error.
pub fn as_padded_string(&self, owner_len: usize) -> String
[src]
Returns a string representing the record in the canonical format, with the owner padded to the given length. Panics when called on an OPT record.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DnsRecord
impl Send for DnsRecord
impl Sync for DnsRecord
impl Unpin for DnsRecord
impl UnwindSafe for DnsRecord
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,