pub struct DefinedTerms(/* private fields */);Expand description
Tracks which terms of one context definition are already defined and which are still being defined, so that cyclic definitions can be detected.
Defining a term can require defining others first — its prefix, or the term
its @id names — so define recurses. A term that is reached again while
its own definition is still in progress is a cycle.
Implementations§
Source§impl DefinedTerms
impl DefinedTerms
Sourcepub fn begin<E>(&mut self, key: &KeyOrKeyword) -> Result<bool, Error<E>>
pub fn begin<E>(&mut self, key: &KeyOrKeyword) -> Result<bool, Error<E>>
Marks key as being defined, and reports whether the caller should go on
to build its definition.
Returns Ok(true) for a term seen for the first time, Ok(false) for one
already fully defined (the caller should do nothing), and
Err(Error::CyclicIriMapping) for one whose definition is still in
progress further up the recursion.
§Errors
Returns an error when the term is already being defined further up the stack, which is a cyclic IRI mapping.
Sourcepub fn end(&mut self, key: &KeyOrKeyword)
pub fn end(&mut self, key: &KeyOrKeyword)
Marks key as fully defined, so that reaching it again is no longer a
cycle.
Does nothing if the term was never passed to Self::begin.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DefinedTerms
impl RefUnwindSafe for DefinedTerms
impl Send for DefinedTerms
impl Sync for DefinedTerms
impl Unpin for DefinedTerms
impl UnsafeUnpin for DefinedTerms
impl UnwindSafe for DefinedTerms
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Unordered reference.