[][src]Struct sophia_term::iri::resolve::IriParsed

pub struct IriParsed<'a> { /* fields omitted */ }

Keeps track of the different components of an IRI reference.

NB: this type does not store the actual text of the IRI reference, it borrows it from one (or possibly several) external strs.

Implementations

impl<'a> IriParsed<'a>[src]

pub fn new(txt: &'a str) -> Result<IriParsed<'a>, InvalidIri>[src]

Parse the given str as an IRI reference, and return its inner structure (or fail with a TermError).

pub fn is_absolute(&self) -> bool[src]

Return true if this IRI reference is absolute.

pub fn join(&self, other: &IriParsed<'a>) -> IriParsed<'a>[src]

Resolve other using this IRI reference as the base.

NB: the resulting IriParsed may borrow parts from both parts.

Trait Implementations

impl<'a> Clone for IriParsed<'a>[src]

impl<'a> Debug for IriParsed<'a>[src]

impl<'a> Default for IriParsed<'a>[src]

impl<'_> Display for IriParsed<'_>[src]

impl<'a> Eq for IriParsed<'a>[src]

impl<'a> PartialEq<IriParsed<'a>> for IriParsed<'a>[src]

impl<'a, 'b, TD> Resolve<&'a Iri<TD>, Iri<MownStr<'a>>> for IriParsed<'b> where
    TD: TermData
[src]

fn resolve(&self, other: &'a Iri<TD>) -> Iri<MownStr<'a>>[src]

Resolve the given IRI.

Performance

May allocate an intermediate IRI if other is suffixed.

impl<'a> Resolve<&'a IriParsed<'a>, IriParsed<'a>> for IriParsed<'a>[src]

fn resolve(&self, other: &'a IriParsed<'a>) -> IriParsed<'a>[src]

Just a call to IriParsed::join()

impl<'a, 'b, TD> Resolve<&'a Literal<TD>, Literal<MownStr<'a>>> for IriParsed<'b> where
    TD: TermData
[src]

fn resolve(&self, other: &'a Literal<TD>) -> Literal<MownStr<'a>>[src]

Resolve the data type's IRI if it is relative.

Note that this only affects datatyped literals; language-tagged literals are absolute by construction.

Performance

May allocate an intermediate IRI if other.dt() is suffixed.

impl<'a, 'b, T> Resolve<&'a Namespace<T>, Namespace<MownStr<'a>>> for IriParsed<'b> where
    T: AsRef<str>, 
[src]

fn resolve(&self, other: &'a Namespace<T>) -> Namespace<MownStr<'a>>[src]

Resolve the IRI of the given Namespace.

impl<'a, 'b, TD> Resolve<&'a Term<TD>, Term<MownStr<'a>>> for IriParsed<'b> where
    TD: TermData
[src]

fn resolve(&self, other: &'a Term<TD>) -> MownTerm<'a>[src]

Resolve IRIs and the IRIs of typed literals.

Performance

May allocate an intermediate IRI if an IRI is suffixed.

impl<'a, 'b> Resolve<&'a str, Result<MownStr<'a>, InvalidIri>> for IriParsed<'b>[src]

fn resolve(&self, other: &'a str) -> Result<MownStr<'a>, InvalidIri>[src]

Resolve an IRI given as String.

Fails if other is not a valid IRI.

impl<'a, 'b> Resolve<Iri<&'a str>, Iri<MownStr<'a>>> for IriParsed<'b>[src]

fn resolve(&self, other: Iri<&'a str>) -> Iri<MownStr<'a>>[src]

Resolve the given IRI.

Performance

May allocate an intermediate IRI if other is suffixed.

Auto Trait Implementations

impl<'a> RefUnwindSafe for IriParsed<'a>

impl<'a> Send for IriParsed<'a>

impl<'a> Sync for IriParsed<'a>

impl<'a> Unpin for IriParsed<'a>

impl<'a> UnwindSafe for IriParsed<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.