pub struct TXT { /* private fields */ }
Expand description
RFC 1035, DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION, November 1987
3.3.14. TXT RDATA format
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ TXT-DATA /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
TXT RRs are used to hold descriptive text. The semantics of the text
depends on the domain where it is found.
Implementations§
Trait Implementations§
source§impl BinEncodable for TXT
impl BinEncodable for TXT
source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
Write the type to the stream
source§impl Display for TXT
impl Display for TXT
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Format a TXT with lossy conversion of invalid utf8.
§Case of invalid utf8
Invalid utf8 will be converted to:
U+FFFD REPLACEMENT CHARACTER
, which looks like this: �
Same behaviour as alloc::string::String::from_utf8_lossy
.
let first_bytes = b"Invalid utf8 <\xF0\x90\x80>.";
let second_bytes = b" Valid utf8 <\xF0\x9F\xA4\xA3>";
let rdata: Vec<&[u8]> = vec![first_bytes, second_bytes];
let txt = TXT::from_bytes(rdata);
let tested = format!("{}", txt);
assert_eq!(
tested.as_bytes(),
b"Invalid utf8 <\xEF\xBF\xBD>. Valid utf8 <\xF0\x9F\xA4\xA3>",
"Utf8 lossy conversion error! Mismatch between input and expected"
);
source§impl RecordData for TXT
impl RecordData for TXT
source§fn try_from_rdata(data: RData) -> Result<Self, RData>
fn try_from_rdata(data: RData) -> Result<Self, RData>
Attempts to convert to this RecordData from the RData type, if it is not the correct type the original is returned
source§fn try_borrow(data: &RData) -> Option<&Self>
fn try_borrow(data: &RData) -> Option<&Self>
Attempts to borrow this RecordData from the RData type, if it is not the correct type the original is returned
source§fn record_type(&self) -> RecordType
fn record_type(&self) -> RecordType
Get the associated RecordType for the RecordData
source§fn into_rdata(self) -> RData
fn into_rdata(self) -> RData
Converts this RecordData into generic RecordData
impl Eq for TXT
impl StructuralPartialEq for TXT
Auto Trait Implementations§
impl Freeze for TXT
impl RefUnwindSafe for TXT
impl Send for TXT
impl Sync for TXT
impl Unpin for TXT
impl UnwindSafe for TXT
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)