pub struct Iri<T: Borrow<str>>(/* private fields */);
Expand description
See Iri::new
.
Implementations§
Source§impl<T: Borrow<str>> Iri<T>
impl<T: Borrow<str>> Iri<T>
Sourcepub fn new(iri: T) -> Result<Self, InvalidIri>
pub fn new(iri: T) -> Result<Self, InvalidIri>
This wrapper guarantees that the underlying str
satisfies the IRI
rule in RFC-3687
(i.e. an absolute IRI with an optional fragment).
Sourcepub fn resolve<U: IsIriRef>(&self, rel: U) -> Iri<String>
pub fn resolve<U: IsIriRef>(&self, rel: U) -> Iri<String>
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 BaseIri
,
with the Iri::as_base
or Iri::to_base
methods.
Sourcepub fn as_base(&self) -> BaseIri<&str>
pub fn as_base(&self) -> BaseIri<&str>
Borrow this IRI as a BaseIri
providing more efficient and flexible resolution methods than Iri::resolve
.
Sourcepub fn to_base(self) -> BaseIri<T>
pub fn to_base(self) -> BaseIri<T>
Turn this IRI into a BaseIri
providing more efficient and flexible resolution methods than Iri::resolve
.
Sourcepub fn new_unchecked(inner: T) -> Self
pub fn new_unchecked(inner: T) -> Self
Construct a Iri<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: Borrow<str> + Deserialize<'a>> Deserialize<'a> for Iri<T>
impl<'a, T: Borrow<str> + Deserialize<'a>> Deserialize<'a> for Iri<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Ord for Iri<T>
impl<T> Ord for Iri<T>
Source§impl<T, U> PartialOrd<Iri<T>> for Iri<U>
impl<T, U> PartialOrd<Iri<T>> for Iri<U>
Source§impl<T> PartialOrd<Iri<T>> for str
impl<T> PartialOrd<Iri<T>> for str
Source§impl<T> PartialOrd<str> for Iri<T>
impl<T> PartialOrd<str> for Iri<T>
impl<T: Copy + Borrow<str>> Copy for Iri<T>
impl<T> Eq for Iri<T>
impl<T: Borrow<str>> IsIri for Iri<T>
impl<T: Borrow<str>> IsIriRef for Iri<T>
Auto Trait Implementations§
impl<T> Freeze for Iri<T>where
T: Freeze,
impl<T> RefUnwindSafe for Iri<T>where
T: RefUnwindSafe,
impl<T> Send for Iri<T>where
T: Send,
impl<T> Sync for Iri<T>where
T: Sync,
impl<T> Unpin for Iri<T>where
T: Unpin,
impl<T> UnwindSafe for Iri<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.