pub enum IriRef {
Iri(IriS),
Prefixed {
prefix: String,
local: String,
},
}Expand description
An IRI reference, which can be either a full IRI or a prefixed name
Variants§
Implementations§
Source§impl IriRef
Functions for working with IriRef
impl IriRef
Functions for working with IriRef
Sourcepub fn get_iri(&self) -> Result<&IriS, IriRefError>
pub fn get_iri(&self) -> Result<&IriS, IriRefError>
Tries to get the IRI
Usually you want to use [self.get_iri_prefixmap] instead
Returns a reference to the IRI if successful, or an IriRefError if it is a prefixed name
Sourcepub fn get_iri_prefixmap(
&self,
prefixmap: &PrefixMap,
) -> Result<Cow<'_, IriS>, PrefixMapError>
pub fn get_iri_prefixmap( &self, prefixmap: &PrefixMap, ) -> Result<Cow<'_, IriS>, PrefixMapError>
Gets the IRI, resolving prefixed names using the provided PrefixMap
Returns a Cow, which is borrowed if the IriRef is already an IRI, or owned if it was a prefixed name.
If the prefixed name cannot be resolved, returns a PrefixMapError
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IriRef
impl<'de> Deserialize<'de> for IriRef
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for IriRef
impl Ord for IriRef
Source§impl PartialOrd for IriRef
impl PartialOrd for IriRef
impl Eq for IriRef
impl StructuralPartialEq for IriRef
Auto Trait Implementations§
impl Freeze for IriRef
impl RefUnwindSafe for IriRef
impl Send for IriRef
impl Sync for IriRef
impl Unpin for IriRef
impl UnsafeUnpin for IriRef
impl UnwindSafe for IriRef
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.