pub struct DnsRecord {
pub name: Option<String>,
pub record_type: Option<String>,
pub dns_class: Option<String>,
pub ttl: Option<u32>,
pub value: Option<String>,
pub priority: Option<u32>,
pub weight: Option<u32>,
pub port: Option<u16>,
}Expand description
A single DNS resource record in a DnsResponse.
Fields§
§name: Option<String>§record_type: Option<String>§dns_class: Option<String>§ttl: Option<u32>§value: Option<String>§priority: Option<u32>§weight: Option<u32>§port: Option<u16>Implementations§
Source§impl DnsRecord
impl DnsRecord
Sourcepub fn a(name: impl Into<String>, ip: impl Into<String>) -> Self
pub fn a(name: impl Into<String>, ip: impl Into<String>) -> Self
Create an A (IPv4 address) record.
Sourcepub fn aaaa(name: impl Into<String>, ip: impl Into<String>) -> Self
pub fn aaaa(name: impl Into<String>, ip: impl Into<String>) -> Self
Create an AAAA (IPv6 address) record.
Sourcepub fn cname(name: impl Into<String>, target: impl Into<String>) -> Self
pub fn cname(name: impl Into<String>, target: impl Into<String>) -> Self
Create a CNAME record.
Sourcepub fn record_type(self, record_type: impl Into<String>) -> Self
pub fn record_type(self, record_type: impl Into<String>) -> Self
Set the record type (e.g. “A”, “AAAA”, “CNAME”, “MX”, “SRV”, “TXT”, “PTR”).
Sourcepub fn dns_class(self, dns_class: impl Into<String>) -> Self
pub fn dns_class(self, dns_class: impl Into<String>) -> Self
Set the DNS class (e.g. “IN”, “CH”, “HS”, “ANY”).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DnsRecord
impl<'de> Deserialize<'de> for DnsRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for DnsRecord
Auto Trait Implementations§
impl Freeze for DnsRecord
impl RefUnwindSafe for DnsRecord
impl Send for DnsRecord
impl Sync for DnsRecord
impl Unpin for DnsRecord
impl UnsafeUnpin for DnsRecord
impl UnwindSafe for DnsRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more