pub trait Parse: Sized {
Show 13 methods
// Required method
fn parse_in<C, E>(
parser: &mut Parser<C, E>,
context: Context,
) -> Result<(Self, usize), Error<E>>
where C: Iterator<Item = Result<DecodedChar, E>>;
// Provided methods
fn parse_slice(content: &[u8]) -> Result<(Self, CodeMap), Error> { ... }
fn parse_slice_with(
content: &[u8],
options: Options,
) -> Result<(Self, CodeMap), Error> { ... }
fn parse_str(content: &str) -> Result<(Self, CodeMap), Error> { ... }
fn parse_str_with(
content: &str,
options: Options,
) -> Result<(Self, CodeMap), Error> { ... }
fn parse_infallible_utf8<C>(chars: C) -> Result<(Self, CodeMap), Error>
where C: Iterator<Item = char> { ... }
fn parse_utf8_infallible_with<C>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error>
where C: Iterator<Item = char> { ... }
fn parse_utf8<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
where C: Iterator<Item = Result<char, E>> { ... }
fn parse_utf8_with<C, E>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error<E>>
where C: Iterator<Item = Result<char, E>> { ... }
fn parse_infallible<C>(chars: C) -> Result<(Self, CodeMap), Error>
where C: Iterator<Item = DecodedChar> { ... }
fn parse_infallible_with<C>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error>
where C: Iterator<Item = DecodedChar> { ... }
fn parse<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
where C: Iterator<Item = Result<DecodedChar, E>> { ... }
fn parse_with<C, E>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error<E>>
where C: Iterator<Item = Result<DecodedChar, E>> { ... }
}Expand description
Required Methods§
Sourcefn parse_in<C, E>(
parser: &mut Parser<C, E>,
context: Context,
) -> Result<(Self, usize), Error<E>>
fn parse_in<C, E>( parser: &mut Parser<C, E>, context: Context, ) -> Result<(Self, usize), Error<E>>
Parses a value in the middle of an ongoing parse, using parser and
the surrounding Context.
Returns the value along with the index of its code map fragment. This is the single method implementors must provide; everything else is a wrapper around it.
Provided Methods§
Sourcefn parse_slice(content: &[u8]) -> Result<(Self, CodeMap), Error>
fn parse_slice(content: &[u8]) -> Result<(Self, CodeMap), Error>
Parses a value from a UTF-8 byte slice.
Sourcefn parse_slice_with(
content: &[u8],
options: Options,
) -> Result<(Self, CodeMap), Error>
fn parse_slice_with( content: &[u8], options: Options, ) -> Result<(Self, CodeMap), Error>
Parses a value from a UTF-8 byte slice, with the given options.
Sourcefn parse_str_with(
content: &str,
options: Options,
) -> Result<(Self, CodeMap), Error>
fn parse_str_with( content: &str, options: Options, ) -> Result<(Self, CodeMap), Error>
Parses a value from a string, with the given options.
Sourcefn parse_infallible_utf8<C>(chars: C) -> Result<(Self, CodeMap), Error>
fn parse_infallible_utf8<C>(chars: C) -> Result<(Self, CodeMap), Error>
Parses a value from an infallible iterator of UTF-8 characters.
Sourcefn parse_utf8_infallible_with<C>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error>
fn parse_utf8_infallible_with<C>( chars: C, options: Options, ) -> Result<(Self, CodeMap), Error>
Parses a value from an infallible iterator of UTF-8 characters, with
the given options.
Sourcefn parse_utf8<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
fn parse_utf8<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
Parses a value from a fallible iterator of UTF-8 characters.
Stream errors of type E are wrapped in Error::Stream.
Sourcefn parse_utf8_with<C, E>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error<E>>
fn parse_utf8_with<C, E>( chars: C, options: Options, ) -> Result<(Self, CodeMap), Error<E>>
Parses a value from a fallible iterator of UTF-8 characters, with the
given options.
Sourcefn parse_infallible<C>(chars: C) -> Result<(Self, CodeMap), Error>where
C: Iterator<Item = DecodedChar>,
fn parse_infallible<C>(chars: C) -> Result<(Self, CodeMap), Error>where
C: Iterator<Item = DecodedChar>,
Parses a value from an infallible iterator of decoded characters.
Unlike the utf8 variants, DecodedChar carries the byte length of
each character in the source encoding, so spans stay accurate when
the input is not UTF-8.
Sourcefn parse_infallible_with<C>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error>where
C: Iterator<Item = DecodedChar>,
fn parse_infallible_with<C>(
chars: C,
options: Options,
) -> Result<(Self, CodeMap), Error>where
C: Iterator<Item = DecodedChar>,
Parses a value from an infallible iterator of decoded characters, with
the given options.
Sourcefn parse<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
fn parse<C, E>(chars: C) -> Result<(Self, CodeMap), Error<E>>
Parses a value from a fallible iterator of decoded characters.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".