Struct sophia_iri::IriRef
source · pub struct IriRef<T: Borrow<str>>(/* private fields */);
Expand description
See IriRef::new
.
Implementations§
source§impl<T: Borrow<str>> IriRef<T>
impl<T: Borrow<str>> IriRef<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 irelative-ref
rule in RFC-3687
(i.e. an absolute or relative IRI reference).
sourcepub fn resolve<U: IsIriRef>(&self, rel: U) -> IriRef<String>
pub fn resolve<U: IsIriRef>(&self, rel: U) -> IriRef<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 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) -> Self
pub fn new_unchecked(inner: T) -> Self
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: Borrow<str> + Deserialize<'a>> Deserialize<'a> for IriRef<T>
impl<'a, T: Borrow<str> + Deserialize<'a>> Deserialize<'a> for IriRef<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 IriRef<T>
impl<T> Ord for IriRef<T>
source§impl<T, U> PartialEq<IriRef<T>> for IriRef<U>
impl<T, U> PartialEq<IriRef<T>> for IriRef<U>
source§impl<T> PartialEq<IriRef<T>> for str
impl<T> PartialEq<IriRef<T>> for str
source§impl<T, U> PartialOrd<IriRef<T>> for IriRef<U>
impl<T, U> PartialOrd<IriRef<T>> for IriRef<U>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T> PartialOrd<IriRef<T>> for str
impl<T> PartialOrd<IriRef<T>> for str
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T> PartialOrd<str> for IriRef<T>
impl<T> PartialOrd<str> for IriRef<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy + Borrow<str>> Copy for IriRef<T>
impl<T> Eq for IriRef<T>
impl<T: Borrow<str>> IsIriRef for IriRef<T>
Auto Trait Implementations§
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, 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.