pub struct Parser { /* private fields */ }Expand description
RDF parser interface
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn with_config(format: RdfFormat, config: ParserConfig) -> Self
pub fn with_config(format: RdfFormat, config: ParserConfig) -> Self
Create a parser with custom configuration
Sourcepub fn with_base_iri(self, base_iri: impl Into<String>) -> Self
pub fn with_base_iri(self, base_iri: impl Into<String>) -> Self
Set the base IRI for resolving relative IRIs
Sourcepub fn with_error_tolerance(self, ignore_errors: bool) -> Self
pub fn with_error_tolerance(self, ignore_errors: bool) -> Self
Enable or disable error tolerance
Sourcepub fn parse_str_to_quads(&self, data: &str) -> Result<Vec<Quad>>
pub fn parse_str_to_quads(&self, data: &str) -> Result<Vec<Quad>>
Parse RDF data from a string into a vector of quads
Sourcepub fn parse_str_to_triples(&self, data: &str) -> Result<Vec<Triple>>
pub fn parse_str_to_triples(&self, data: &str) -> Result<Vec<Triple>>
Parse RDF data from a string into a vector of triples (only default graph)
Sourcepub fn parse_str_with_handler<F>(&self, data: &str, handler: F) -> Result<()>
pub fn parse_str_with_handler<F>(&self, data: &str, handler: F) -> Result<()>
Parse RDF data with a custom handler for each quad
pub fn parse_ntriples_line(&self, line: &str) -> Result<Option<Quad>>
pub fn parse_nquads_line(&self, line: &str) -> Result<Option<Quad>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more