sophia_api::parser

Trait TripleParser

Source
pub trait TripleParser<T> {
    type Source: TripleSource;

    // Required method
    fn parse(&self, data: T) -> Self::Source;

    // Provided method
    fn parse_str<'t>(&self, txt: &'t str) -> Self::Source
       where &'t str: IntoParsable<Target = T> { ... }
}
Expand description

A parser takes some data of type T, and returns a TripleSource.

Required Associated Types§

Source

type Source: TripleSource

The source produced by this parser

Required Methods§

Source

fn parse(&self, data: T) -> Self::Source

Parses data into a triple source.

Provided Methods§

Source

fn parse_str<'t>(&self, txt: &'t str) -> Self::Source
where &'t str: IntoParsable<Target = T>,

Convenient shortcut method for parsing strings.

It may not be available on some exotic parsers, but will be automatically supported for parsers supporting any BufRead or Read.

Implementors§