pub trait ParserExt<RDF>: RDFNodeParse<RDF> + Sizedwhere
RDF: FocusRDF,{
Show 15 methods
// Provided methods
fn map<F, B>(self, f: F) -> Map<Self, F>
where F: Fn(Self::Output) -> B { ... }
fn and_then<F, O>(self, func: F) -> AndThen<Self, F>
where F: Fn(Self::Output) -> Result<O, RDFError> { ... }
fn flat_map<F, O>(self, function: F) -> FlatMap<Self, F>
where F: Fn(Self::Output) -> Result<O, RDFError> { ... }
fn then<F, N>(self, function: F) -> Then<Self, F>
where F: Fn(Self::Output) -> N,
N: RDFNodeParse<RDF> { ... }
fn optional(self) -> Optional<Self> { ... }
fn or<P>(self, other: P) -> Or<Self, P>
where P: RDFNodeParse<RDF, Output = Self::Output> { ... }
fn and<P, B>(self, other: P) -> And<Self, P>
where P: RDFNodeParse<RDF, Output = B> { ... }
fn not(self) -> Not<Self>
where Self::Output: Debug { ... }
fn with<P, B>(self, other: P) -> With<Self, P>
where P: RDFNodeParse<RDF, Output = B> { ... }
fn combine<P, A>(self, other: P) -> Combine<Self, P>
where Self: RDFNodeParse<RDF, Output = Vec<A>>,
P: RDFNodeParse<RDF, Output = Vec<A>> { ... }
fn combine_many<A>(
self,
others: Vec<Box<dyn RDFNodeParse<RDF, Output = Vec<A>>>>,
) -> CombineMany<RDF, A>
where Self: RDFNodeParse<RDF, Output = Vec<A>> + 'static,
RDF: 'static { ... }
fn for_each(self, nodes: Vec<RDF::Term>) -> ForEach<RDF, Self>
where Self: Clone { ... }
fn list<A>(self) -> List<RDF, Self>
where Self: RDFNodeParse<RDF, Output = A> { ... }
fn opaque<F>(f: F) -> Opaque<F, RDF, Self::Output>
where F: FnMut(&mut dyn FnMut(&mut dyn RDFNodeParse<RDF, Output = Self::Output>)) { ... }
fn map_property(self, property: IriS) -> MapPropertyValuesParser<RDF, Self>
where Self: RDFNodeParse<RDF> { ... }
}Expand description
Extension trait providing fluent combinator methods for parsers.
Automatically implemented for all types implementing RDFNodeParse<RDF>,
enabling method chaining for parser composition.
Provided Methods§
Sourcefn and_then<F, O>(self, func: F) -> AndThen<Self, F>
fn and_then<F, O>(self, func: F) -> AndThen<Self, F>
Chains a fallible transformation after this parser.
Sourcefn flat_map<F, O>(self, function: F) -> FlatMap<Self, F>
fn flat_map<F, O>(self, function: F) -> FlatMap<Self, F>
Chains a fallible transformation (monadic bind).
Sourcefn then<F, N>(self, function: F) -> Then<Self, F>
fn then<F, N>(self, function: F) -> Then<Self, F>
Creates a dependent parser consuming this parser’s output.
Sourcefn or<P>(self, other: P) -> Or<Self, P>where
P: RDFNodeParse<RDF, Output = Self::Output>,
fn or<P>(self, other: P) -> Or<Self, P>where
P: RDFNodeParse<RDF, Output = Self::Output>,
Provides an alternative parser if this one fails.
Sourcefn and<P, B>(self, other: P) -> And<Self, P>where
P: RDFNodeParse<RDF, Output = B>,
fn and<P, B>(self, other: P) -> And<Self, P>where
P: RDFNodeParse<RDF, Output = B>,
Combines this parser with another, returning both results as a tuple.
Sourcefn with<P, B>(self, other: P) -> With<Self, P>where
P: RDFNodeParse<RDF, Output = B>,
fn with<P, B>(self, other: P) -> With<Self, P>where
P: RDFNodeParse<RDF, Output = B>,
Runs this parser for side effects, then returns the result of another.
Sourcefn combine_many<A>(
self,
others: Vec<Box<dyn RDFNodeParse<RDF, Output = Vec<A>>>>,
) -> CombineMany<RDF, A>where
Self: RDFNodeParse<RDF, Output = Vec<A>> + 'static,
RDF: 'static,
fn combine_many<A>(
self,
others: Vec<Box<dyn RDFNodeParse<RDF, Output = Vec<A>>>>,
) -> CombineMany<RDF, A>where
Self: RDFNodeParse<RDF, Output = Vec<A>> + 'static,
RDF: 'static,
Combines multiple vector-producing parsers by erasing their types into Boxes.
Sourcefn for_each(self, nodes: Vec<RDF::Term>) -> ForEach<RDF, Self>where
Self: Clone,
fn for_each(self, nodes: Vec<RDF::Term>) -> ForEach<RDF, Self>where
Self: Clone,
Applies this parser to multiple nodes.
Sourcefn list<A>(self) -> List<RDF, Self>where
Self: RDFNodeParse<RDF, Output = A>,
fn list<A>(self) -> List<RDF, Self>where
Self: RDFNodeParse<RDF, Output = A>,
Parses an RDF list using this parser for elements.
Sourcefn opaque<F>(f: F) -> Opaque<F, RDF, Self::Output>
fn opaque<F>(f: F) -> Opaque<F, RDF, Self::Output>
Wraps dynamic parser dispatch for runtime parser selection.
Sourcefn map_property(self, property: IriS) -> MapPropertyValuesParser<RDF, Self>where
Self: RDFNodeParse<RDF>,
fn map_property(self, property: IriS) -> MapPropertyValuesParser<RDF, Self>where
Self: RDFNodeParse<RDF>,
Applies this parser to all values of a property.
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.