pub struct NodeMap<T, B> { /* private fields */ }Expand description
Node identifier to node definition map.
Graphs are stored in declaration order so that flattening is deterministic: §4.9 of the JSON-LD API assigns blank node identifiers in document traversal order.
Implementations§
Source§impl<T, B> NodeMap<T, B>
impl<T, B> NodeMap<T, B>
Sourcepub fn into_parts(self) -> Parts<T, B>
pub fn into_parts(self) -> Parts<T, B>
Consumes the node map, returning its default graph and named graphs.
Sourcepub fn iter(&self) -> Iter<'_, T, B> ⓘ
pub fn iter(&self) -> Iter<'_, T, B> ⓘ
Returns an iterator over the graphs of the node map: the default graph first, then the named graphs in declaration order.
Sourcepub fn iter_named(&self) -> Iter<'_, Id<T, B>, NodeMapGraph<T, B>> ⓘ
pub fn iter_named(&self) -> Iter<'_, Id<T, B>, NodeMapGraph<T, B>> ⓘ
Returns an iterator over the named graphs only, in declaration order.
Source§impl<T: Eq + Hash, B: Eq + Hash> NodeMap<T, B>
impl<T: Eq + Hash, B: Eq + Hash> NodeMap<T, B>
Sourcepub fn graph(&self, id: Option<&Id<T, B>>) -> Option<&NodeMapGraph<T, B>>
pub fn graph(&self, id: Option<&Id<T, B>>) -> Option<&NodeMapGraph<T, B>>
Returns the graph of the given name, or the default graph for None,
if it is declared.
Sourcepub fn graph_mut(
&mut self,
id: Option<&Id<T, B>>,
) -> Option<&mut NodeMapGraph<T, B>>
pub fn graph_mut( &mut self, id: Option<&Id<T, B>>, ) -> Option<&mut NodeMapGraph<T, B>>
Mutably borrows the graph of the given name, if it is declared.
Sourcepub fn declare_graph(&mut self, id: Id<T, B>)
pub fn declare_graph(&mut self, id: Id<T, B>)
Declares a named graph, leaving it untouched if it already exists.
Sourcepub fn merge(self) -> NodeMapGraph<T, B>
pub fn merge(self) -> NodeMapGraph<T, B>
Merge all the graphs into a single NodeMapGraph.
Graphs are merged into the default graph in declaration order.
Source§impl<T: Clone + Eq + Hash, B: Clone + Eq + Hash> NodeMap<T, B>
impl<T: Clone + Eq + Hash, B: Clone + Eq + Hash> NodeMap<T, B>
Sourcepub fn flatten(self, ordered: bool) -> FlattenedDocument<T, B>where
(): Vocabulary<Iri = T, BlankId = B>,
pub fn flatten(self, ordered: bool) -> FlattenedDocument<T, B>where
(): Vocabulary<Iri = T, BlankId = B>,
Flattens this node map into a list of nodes, sorted when ordered is
set.
Sourcepub fn flatten_with<V>(
self,
vocabulary: &V,
ordered: bool,
) -> FlattenedDocument<T, B>where
V: Vocabulary<Iri = T, BlankId = B>,
pub fn flatten_with<V>(
self,
vocabulary: &V,
ordered: bool,
) -> FlattenedDocument<T, B>where
V: Vocabulary<Iri = T, BlankId = B>,
Flattens this node map into a list of nodes, sorting through the given
vocabulary when ordered is set.
Sourcepub fn flatten_unordered(self) -> HashSet<IndexedNode<T, B>>
pub fn flatten_unordered(self) -> HashSet<IndexedNode<T, B>>
Flattens this node map into an unordered set of nodes.
Trait Implementations§
Source§impl<'a, T, B> IntoIterator for &'a NodeMap<T, B>
impl<'a, T, B> IntoIterator for &'a NodeMap<T, B>
Source§impl<T, B> IntoIterator for NodeMap<T, B>
impl<T, B> IntoIterator for NodeMap<T, B>
Source§impl<T: Eq + Hash, B: Eq + Hash> RdfQuads<T, B> for NodeMap<T, B>
impl<T: Eq + Hash, B: Eq + Hash> RdfQuads<T, B> for NodeMap<T, B>
Source§fn rdf_quads_full<'a, V: Vocabulary<Iri = T, BlankId = B>, G: LocalGenerator>(
&'a self,
vocabulary: &'a mut V,
generator: &'a mut G,
rdf_direction: Option<RdfDirection>,
produce_generalized_rdf: bool,
) -> Quads<'a, V, G> ⓘ
fn rdf_quads_full<'a, V: Vocabulary<Iri = T, BlankId = B>, G: LocalGenerator>( &'a self, vocabulary: &'a mut V, generator: &'a mut G, rdf_direction: Option<RdfDirection>, produce_generalized_rdf: bool, ) -> Quads<'a, V, G> ⓘ
Source§fn rdf_quads_with<'a, V: Vocabulary<Iri = T, BlankId = B>, G: LocalGenerator>(
&'a self,
vocabulary: &'a mut V,
generator: &'a mut G,
rdf_direction: Option<RdfDirection>,
) -> Quads<'a, V, G> ⓘ
fn rdf_quads_with<'a, V: Vocabulary<Iri = T, BlankId = B>, G: LocalGenerator>( &'a self, vocabulary: &'a mut V, generator: &'a mut G, rdf_direction: Option<RdfDirection>, ) -> Quads<'a, V, G> ⓘ
Source§fn rdf_quads<'a, G: LocalGenerator>(
&'a self,
generator: &'a mut G,
rdf_direction: Option<RdfDirection>,
) -> Quads<'a, (), G> ⓘwhere
(): Vocabulary<Iri = T, BlankId = B>,
fn rdf_quads<'a, G: LocalGenerator>(
&'a self,
generator: &'a mut G,
rdf_direction: Option<RdfDirection>,
) -> Quads<'a, (), G> ⓘwhere
(): Vocabulary<Iri = T, BlankId = B>,
Auto Trait Implementations§
impl<T, B> Freeze for NodeMap<T, B>
impl<T, B> RefUnwindSafe for NodeMap<T, B>where
IndexMap<Id<T, B>, NodeMapGraph<T, B>, GxBuildHasher>: RefUnwindSafe,
NodeMapGraph<T, B>: RefUnwindSafe,
impl<T, B> Send for NodeMap<T, B>
impl<T, B> Sync for NodeMap<T, B>
impl<T, B> Unpin for NodeMap<T, B>
impl<T, B> UnsafeUnpin for NodeMap<T, B>where
IndexMap<Id<T, B>, NodeMapGraph<T, B>, GxBuildHasher>: UnsafeUnpin,
NodeMapGraph<T, B>: UnsafeUnpin,
impl<T, B> UnwindSafe for NodeMap<T, B>where
IndexMap<Id<T, B>, NodeMapGraph<T, B>, GxBuildHasher>: UnwindSafe,
NodeMapGraph<T, B>: UnwindSafe,
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.