Struct simple_dns::rdata::TXT
source · pub struct TXT<'a> { /* private fields */ }
Expand description
Represents a TXT Resource Record
Implementations§
source§impl<'a> TXT<'a>
impl<'a> TXT<'a>
sourcepub fn add_string(&mut self, char_string: &'a str) -> Result<()>
pub fn add_string(&mut self, char_string: &'a str) -> Result<()>
Add char_string
to this TXT record as a validated CharacterString
sourcepub fn add_char_string(&mut self, char_string: CharacterString<'a>)
pub fn add_char_string(&mut self, char_string: CharacterString<'a>)
Add char_string
to this TXT record
sourcepub fn with_string(self, char_string: &'a str) -> Result<Self>
pub fn with_string(self, char_string: &'a str) -> Result<Self>
Add char_string
to this TXT record as a validated CharacterString
, consuming and returning Self
sourcepub fn with_char_string(self, char_string: CharacterString<'a>) -> Self
pub fn with_char_string(self, char_string: CharacterString<'a>) -> Self
Add char_string
to this TXT record, consuming and returning Self
sourcepub fn attributes(&self) -> HashMap<String, Option<String>>
pub fn attributes(&self) -> HashMap<String, Option<String>>
Returns parsed attributes from this TXT Record, valid formats are:
- key=value
- key=
- key
If a key is duplicated, only the first one will be considered
sourcepub fn long_attributes(self) -> Result<HashMap<String, Option<String>>>
pub fn long_attributes(self) -> Result<HashMap<String, Option<String>>>
Similar to attributes()
but it parses the full TXT record as a single string,
instead of expecting each attribute to be a separate CharacterString
sourcepub fn into_owned<'b>(self) -> TXT<'b>
pub fn into_owned<'b>(self) -> TXT<'b>
Transforms the inner data into its owned type
Trait Implementations§
source§impl<'a> PartialEq for TXT<'a>
impl<'a> PartialEq for TXT<'a>
impl<'a> Eq for TXT<'a>
impl<'a> StructuralPartialEq for TXT<'a>
Auto Trait Implementations§
impl<'a> Freeze for TXT<'a>
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
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
)