pub struct Txt<'a> { /* private fields */ }Expand description
The txt record
This record is used to hold arbitrary text data.
Implementations§
source§impl<'a> Txt<'a>
impl<'a> Txt<'a>
sourcepub fn new(data: &'a [u8]) -> Result<Self, DnsMessageError>
pub fn new(data: &'a [u8]) -> Result<Self, DnsMessageError>
Creates a new txt record and checks the data. The data needs to be in DNS wire format. The maximum length of a single text value is 255. If the data is invalid, this function will return an error.
Example
use flex_dns::rdata::Txt;
let txt = Txt::new(
b"\x05Hello\x06World!"
).unwrap();sourcepub const unsafe fn new_unchecked(data: &'a [u8]) -> Self
pub const unsafe fn new_unchecked(data: &'a [u8]) -> Self
Creates a new txt record without checking the data. This function is unsafe because it doesn’t check the data. If the data is invalid it can lead to an invalid DNS message.
Trait Implementations§
source§impl<'a> PartialEq<Txt<'a>> for Txt<'a>
impl<'a> PartialEq<Txt<'a>> for Txt<'a>
impl<'a> Copy for Txt<'a>
impl<'a> StructuralPartialEq for Txt<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Txt<'a>
impl<'a> Send for Txt<'a>
impl<'a> Sync for Txt<'a>
impl<'a> Unpin for Txt<'a>
impl<'a> UnwindSafe for Txt<'a>
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