pub trait RDataParser: Sized {
// Required method
fn parse<'i, I: Iterator<Item = &'i str>>(
record_type: RecordType,
tokens: I,
origin: Option<&Name>,
) -> ParseResult<Self>;
// Provided method
fn try_from_str(record_type: RecordType, s: &str) -> ParseResult<Self> { ... }
}
Available on crate feature
text-parsing
only.Expand description
Extension on RData for text parsing
Required Methods§
Sourcefn parse<'i, I: Iterator<Item = &'i str>>(
record_type: RecordType,
tokens: I,
origin: Option<&Name>,
) -> ParseResult<Self>
fn parse<'i, I: Iterator<Item = &'i str>>( record_type: RecordType, tokens: I, origin: Option<&Name>, ) -> ParseResult<Self>
Attempts to parse a stream of tokenized strs into the RData of the specified record type
Provided Methods§
Sourcefn try_from_str(record_type: RecordType, s: &str) -> ParseResult<Self>
fn try_from_str(record_type: RecordType, s: &str) -> ParseResult<Self>
Parse RData from a string
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.