pub struct IriRef<T>(/* private fields */)
where
T: Borrow<str>;
Expand description
See IriRef::new
.
Implementations§
Source§impl<T> IriRef<T>
impl<T> IriRef<T>
Sourcepub fn new(iri: T) -> Result<IriRef<T>, InvalidIri>
pub fn new(iri: T) -> Result<IriRef<T>, InvalidIri>
This wrapper guarantees that the underlying str
satisfies the irelative-ref
rule in RFC-3687
(i.e. an absolute or relative IRI reference).
Sourcepub fn resolve<U>(&self, rel: U) -> IriRef<String>where
U: IsIriRef,
pub fn resolve<U>(&self, rel: U) -> IriRef<String>where
U: IsIriRef,
Resolve a relative IRI reference against this one.
NB: when resolving multiple IRI references against the same base,
it is preferable to first turn it into a BaseIriRef
,
with the IriRef::as_base
or IriRef::to_base
methods.
Sourcepub fn as_base(&self) -> BaseIriRef<&str>
pub fn as_base(&self) -> BaseIriRef<&str>
Borrow this IRI as a BaseIriRef
providing more efficient and flexible resolution methods than IriRef::resolve
.
Sourcepub fn to_base(self) -> BaseIriRef<T>
pub fn to_base(self) -> BaseIriRef<T>
Turn this IRI into a BaseIriRef
providing more efficient and flexible resolution methods than IriRef::resolve
.
Sourcepub fn new_unchecked(inner: T) -> IriRef<T>
pub fn new_unchecked(inner: T) -> IriRef<T>
Construct a IriRef<T>
without checking that the inner value is valid. If it is not, it may result in undefined behaviour.
Trait Implementations§
Source§impl<'a, T> Deserialize<'a> for IriRef<T>
impl<'a, T> Deserialize<'a> for IriRef<T>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<IriRef<T>, <D as Deserializer<'a>>::Error>where
D: Deserializer<'a>,
fn deserialize<D>(
deserializer: D,
) -> Result<IriRef<T>, <D as Deserializer<'a>>::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Ord for IriRef<T>
impl<T> Ord for IriRef<T>
Source§impl<T, U> PartialOrd<IriRef<T>> for IriRef<U>
impl<T, U> PartialOrd<IriRef<T>> for IriRef<U>
Source§impl<T> PartialOrd<IriRef<T>> for str
impl<T> PartialOrd<IriRef<T>> for str
Source§impl<T> PartialOrd<str> for IriRef<T>
impl<T> PartialOrd<str> for IriRef<T>
Source§impl<T> Serialize for IriRef<T>
impl<T> Serialize for IriRef<T>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<T> Term for IriRef<T>
impl<T> Term for IriRef<T>
Source§type BorrowTerm<'x> = &'x IriRef<T>
where
T: 'x
type BorrowTerm<'x> = &'x IriRef<T> where T: 'x
A type of
Term
that can be borrowed from this type
(i.e. that can be obtained from a simple reference to this type).
It is used in particular for accessing constituents of quoted tripes (Term::triple
)
or for sharing this term with a function that expects T: Term
(rather than &T
)
using Term::borrow_term
. Read moreSource§fn borrow_term(&self) -> Self::BorrowTerm<'_>
fn borrow_term(&self) -> Self::BorrowTerm<'_>
Source§fn is_blank_node(&self) -> bool
fn is_blank_node(&self) -> bool
Source§fn is_literal(&self) -> bool
fn is_literal(&self) -> bool
Source§fn is_variable(&self) -> bool
fn is_variable(&self) -> bool
Source§fn bnode_id(&self) -> Option<BnodeId<MownStr<'_>>>
fn bnode_id(&self) -> Option<BnodeId<MownStr<'_>>>
If
kind
returns TermKind::BlankNode
,
return the locally unique label of this blank node.
Otherwise return None
. Read moreSource§fn lexical_form(&self) -> Option<MownStr<'_>>
fn lexical_form(&self) -> Option<MownStr<'_>>
If
kind
returns TermKind::Literal
,
return the lexical form of this literal.
Otherwise return None
. Read moreSource§fn datatype(&self) -> Option<IriRef<MownStr<'_>>>
fn datatype(&self) -> Option<IriRef<MownStr<'_>>>
If
kind
returns TermKind::Literal
,
return the datatype IRI of this literal.
Otherwise return None
. Read moreSource§fn language_tag(&self) -> Option<LanguageTag<MownStr<'_>>>
fn language_tag(&self) -> Option<LanguageTag<MownStr<'_>>>
If
kind
returns TermKind::Literal
,
and if this literal is a language-tagged string,
return its language tag.
Otherwise return None
. Read moreSource§fn variable(&self) -> Option<VarName<MownStr<'_>>>
fn variable(&self) -> Option<VarName<MownStr<'_>>>
If
kind
returns TermKind::Variable
,
return the name of this variable.
Otherwise return None
. Read moreSource§fn to_triple(self) -> Option<[Self; 3]>where
Self: Sized,
fn to_triple(self) -> Option<[Self; 3]>where
Self: Sized,
If
kind
returns TermKind::Triple
,
return this triple, consuming this term.
Otherwise return None
. Read moreSource§fn constituents<'s>(
&'s self,
) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>
fn constituents<'s>( &'s self, ) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>
Iter over all the constituents of this term. Read more
Source§fn to_constituents<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>where
Self: Clone + 'a,
fn to_constituents<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>where
Self: Clone + 'a,
Iter over all the constiutents of this term, consuming it. Read more
Source§fn eq<T: Term>(&self, other: T) -> bool
fn eq<T: Term>(&self, other: T) -> bool
Check whether
self
and other
represent the same RDF term.Source§fn hash<H: Hasher>(&self, state: &mut H)
fn hash<H: Hasher>(&self, state: &mut H)
Compute an implementation-independant hash of this RDF term.
Source§fn into_term<T: FromTerm>(self) -> Twhere
Self: Sized,
fn into_term<T: FromTerm>(self) -> Twhere
Self: Sized,
Convert this term in another type. Read more
Source§fn try_into_term<T: TryFromTerm>(self) -> Result<T, T::Error>where
Self: Sized,
fn try_into_term<T: TryFromTerm>(self) -> Result<T, T::Error>where
Self: Sized,
Try to convert this term into another type. Read more
Source§fn as_simple(&self) -> SimpleTerm<'_>
fn as_simple(&self) -> SimpleTerm<'_>
Copies this term into a
SimpleTerm
,
borrowing as much as possible from self
(calling SimpleTerm::from_term_ref
).impl<T> Copy for IriRef<T>
impl<T> Eq for IriRef<T>
impl<T> IsIriRef for IriRef<T>
Auto Trait Implementations§
impl<T> Freeze for IriRef<T>where
T: Freeze,
impl<T> RefUnwindSafe for IriRef<T>where
T: RefUnwindSafe,
impl<T> Send for IriRef<T>where
T: Send,
impl<T> Sync for IriRef<T>where
T: Sync,
impl<T> Unpin for IriRef<T>where
T: Unpin,
impl<T> UnwindSafe for IriRef<T>where
T: 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
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<T, U> Resolvable<T> for U
impl<T, U> Resolvable<T> for U
Source§fn output_abs(res: Result<T, IriParseError>) -> <U as Resolvable<T>>::OutputAbs
fn output_abs(res: Result<T, IriParseError>) -> <U as Resolvable<T>>::OutputAbs
Method for producing the
Self::OutputAbs
from a raw result.Source§fn output_rel(res: Result<T, IriParseError>) -> <U as Resolvable<T>>::OutputRel
fn output_rel(res: Result<T, IriParseError>) -> <U as Resolvable<T>>::OutputRel
Method for producing the
Self::OutputRel
from a raw result.