pub struct PrefixMapping { /* private fields */ }
Expand description
Implementation of a mapping from a prefix Name
to an Iri
. Prefix mappings are commonly used
in the serialization of graphs.
Implementations§
Source§impl PrefixMapping
impl PrefixMapping
pub fn common() -> Self
Sourcepub fn with_default(self, iri: Iri) -> Selfwhere
Self: Sized,
pub fn with_default(self, iri: Iri) -> Selfwhere
Self: Sized,
Construct a new mapping instance with the provided default namespace.
Sourcepub fn with_dc_terms(self) -> Selfwhere
Self: Sized,
pub fn with_dc_terms(self) -> Selfwhere
Self: Sized,
Include the common “dc::terms” mapping.
Sourcepub fn with_dc_elements(self) -> Selfwhere
Self: Sized,
pub fn with_dc_elements(self) -> Selfwhere
Self: Sized,
Include the common “dc::elements” mapping.
Sourcepub fn with_xsd(self) -> Selfwhere
Self: Sized,
pub fn with_xsd(self) -> Selfwhere
Self: Sized,
Include the common “xsd” (XML Schema Data types) mapping.
pub fn with(self, prefix: Name, iri: Iri) -> Selfwhere
Self: Sized,
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if there are no mappings in this instance, else false
.
Sourcepub fn get_default_namespace(&self) -> Option<&Iri>
pub fn get_default_namespace(&self) -> Option<&Iri>
Get the default namespace mapping, if present.
Sourcepub fn set_default_namespace(&mut self, iri: Iri)
pub fn set_default_namespace(&mut self, iri: Iri)
Set the default namespace mapping.
pub fn remove_default_namespace(&mut self)
Sourcepub fn get_namespace(&self, prefix: &Name) -> Option<&Iri>
pub fn get_namespace(&self, prefix: &Name) -> Option<&Iri>
Get the namespace Iri associated with this provided prefix, if present.
Sourcepub fn get_prefix(&self, namespace: &Iri) -> Option<&Option<Name>>
pub fn get_prefix(&self, namespace: &Iri) -> Option<&Option<Name>>
Get the prefix associated with this provided namespace URI, if present.
Sourcepub fn mappings<'a>(
&'a self,
) -> Box<dyn Iterator<Item = (&'a Option<Name>, &'a Iri)> + 'a>
pub fn mappings<'a>( &'a self, ) -> Box<dyn Iterator<Item = (&'a Option<Name>, &'a Iri)> + 'a>
Return an iterator over the contained mappings.
Sourcepub fn insert(&mut self, prefix: Name, iri: Iri)
pub fn insert(&mut self, prefix: Name, iri: Iri)
Insert a mapping from the prefix string to the namespace Iri.
pub fn insert_owl(&mut self)
pub fn insert_rdf(&mut self)
pub fn insert_rdfs(&mut self)
pub fn insert_xsd(&mut self)
pub fn insert_foaf(&mut self)
pub fn insert_dc_elements(&mut self)
pub fn insert_dc_terms(&mut self)
pub fn insert_skos(&mut self)
pub fn insert_skos_xl(&mut self)
pub fn insert_skos_iso(&mut self)
Trait Implementations§
Source§impl Clone for PrefixMapping
impl Clone for PrefixMapping
Source§fn clone(&self) -> PrefixMapping
fn clone(&self) -> PrefixMapping
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 PrefixMapping
impl Debug for PrefixMapping
Source§impl Default for PrefixMapping
impl Default for PrefixMapping
Source§fn default() -> PrefixMapping
fn default() -> PrefixMapping
Returns the “default value” for a type. Read more
Source§impl PartialEq for PrefixMapping
impl PartialEq for PrefixMapping
impl Eq for PrefixMapping
impl StructuralPartialEq for PrefixMapping
Auto Trait Implementations§
impl Freeze for PrefixMapping
impl RefUnwindSafe for PrefixMapping
impl Send for PrefixMapping
impl Sync for PrefixMapping
impl Unpin for PrefixMapping
impl UnwindSafe for PrefixMapping
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