pub struct TurtleContext {
pub base_iri: Option<String>,
pub prefixes: HashMap<String, String>,
pub blank_node_counter: u64,
pub position: TextPosition,
}Expand description
Turtle parser context for prefix management and base IRI resolution
Fields§
§base_iri: Option<String>Current base IRI for relative IRI resolution
prefixes: HashMap<String, String>Prefix declarations mapping prefix -> IRI
blank_node_counter: u64Auto-generated blank node counter
position: TextPositionCurrent position for error reporting
Implementations§
Source§impl TurtleContext
impl TurtleContext
pub fn new() -> Self
Sourcepub fn resolve_prefixed_name(
&self,
prefix: Option<&str>,
local: &str,
) -> ParseResult<String>
pub fn resolve_prefixed_name( &self, prefix: Option<&str>, local: &str, ) -> ParseResult<String>
Resolve a prefixed name to a full IRI
Sourcepub fn resolve_iri(&self, iri: &str) -> ParseResult<String>
pub fn resolve_iri(&self, iri: &str) -> ParseResult<String>
Resolve a relative IRI against the base IRI
Sourcepub fn generate_blank_node(&mut self) -> BlankNode
pub fn generate_blank_node(&mut self) -> BlankNode
Generate a new anonymous blank node
Trait Implementations§
Source§impl Clone for TurtleContext
impl Clone for TurtleContext
Source§fn clone(&self) -> TurtleContext
fn clone(&self) -> TurtleContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TurtleContext
impl Debug for TurtleContext
Auto Trait Implementations§
impl Freeze for TurtleContext
impl RefUnwindSafe for TurtleContext
impl Send for TurtleContext
impl Sync for TurtleContext
impl Unpin for TurtleContext
impl UnsafeUnpin for TurtleContext
impl UnwindSafe for TurtleContext
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