Skip to main content

Relabel

Trait Relabel 

Source
pub trait Relabel<T, B> {
    // Required method
    fn relabel_with<N: VocabularyMut<Iri = T, BlankId = B>, G: LocalGenerator>(
        &mut self,
        vocabulary: &mut N,
        generator: &mut G,
        relabeling: &mut HashMap<B, ValidId<T, B>>,
    ) -> Result<(), GeneratedIdError>
       where T: Clone + Eq + Hash,
             B: Clone + Eq + Hash;

    // Provided method
    fn relabel<G: LocalGenerator>(
        &mut self,
        generator: &mut G,
        relabeling: &mut HashMap<B, ValidId<T, B>>,
    ) -> Result<(), GeneratedIdError>
       where T: Clone + Eq + Hash,
             B: Clone + Eq + Hash,
             (): Vocabulary<Iri = T, BlankId = B> { ... }
}
Expand description

Fragments whose blank node identifiers can be renamed.

Required Methods§

Source

fn relabel_with<N: VocabularyMut<Iri = T, BlankId = B>, G: LocalGenerator>( &mut self, vocabulary: &mut N, generator: &mut G, relabeling: &mut HashMap<B, ValidId<T, B>>, ) -> Result<(), GeneratedIdError>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash,

Relabels every blank node, recording the mapping so shared nodes keep the same new identifier.

§Errors

Returns an error when the generator runs out of identifiers.

Provided Methods§

Source

fn relabel<G: LocalGenerator>( &mut self, generator: &mut G, relabeling: &mut HashMap<B, ValidId<T, B>>, ) -> Result<(), GeneratedIdError>
where T: Clone + Eq + Hash, B: Clone + Eq + Hash, (): Vocabulary<Iri = T, BlankId = B>,

Relabels every blank node, recording the mapping.

§Errors

Returns an error when the generator runs out of identifiers.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, B> Relabel<T, B> for FlattenedDocument<T, B>

Source§

impl<T, B> Relabel<T, B> for List<T, B>

Source§

impl<T, B> Relabel<T, B> for Node<T, B>

Source§

impl<T, B> Relabel<T, B> for Object<T, B>