pub struct Normalized<'a, T: ?Sized> { /* private fields */ }
Expand description
Normalized OR resolved IRI.
Resolved IRI can be represented by this type. In that case, the result might
not be normalized. If you want the IRI resolution result to be normalized,
use enable_normalization
method.
Implementations§
source§impl<'a, T: ?Sized> Normalized<'a, T>
impl<'a, T: ?Sized> Normalized<'a, T>
sourcepub fn enable_normalization(&mut self)
pub fn enable_normalization(&mut self)
Enables the normalization.
This lets the normalizer apply the case normalization, percent-encoding normalization, and dot segments removal.
Enables the normalization that preserve relative path under some condition.
Note that this normalization algorithm is not compatible with RFC 3986 algorithm for some inputs.
See RiStr::normalize_but_preserve_authorityless_relative_path()
for detail.
sourcepub fn and_normalize(self) -> Self
pub fn and_normalize(self) -> Self
Returns Self
with normalization enabled.
Returns Self
with special normalization enabled.
Note that this normalization algorithm is not compatible with RFC 3986 algorithm for some inputs.
See RiStr::normalize_but_preserve_authorityless_relative_path()
for detail.
sourcepub fn ensure_rfc3986_normalizable(&self) -> Result<(), Error>
pub fn ensure_rfc3986_normalizable(&self) -> Result<(), Error>
Checks if the path is normalizable by RFC 3986 algorithm.
Returns Ok(())
when normalizable, returns Err(_)
if not.
Trait Implementations§
source§impl<T: ?Sized> Debug for Normalized<'_, T>
impl<T: ?Sized> Debug for Normalized<'_, T>
source§impl<S: Spec> Display for Normalized<'_, RiAbsoluteStr<S>>
impl<S: Spec> Display for Normalized<'_, RiAbsoluteStr<S>>
source§impl<S: Spec> From<&Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
Available on crate feature alloc
only.
impl<S: Spec> From<&Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
alloc
only.source§fn from(v: &Normalized<'_, RiAbsoluteStr<S>>) -> Self
fn from(v: &Normalized<'_, RiAbsoluteStr<S>>) -> Self
source§impl<S: Spec> From<&Normalized<'_, RiStr<S>>> for RiString<S>
Available on crate feature alloc
only.
impl<S: Spec> From<&Normalized<'_, RiStr<S>>> for RiString<S>
alloc
only.source§fn from(v: &Normalized<'_, RiStr<S>>) -> Self
fn from(v: &Normalized<'_, RiStr<S>>) -> Self
source§impl<S: Spec> From<Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
Available on crate feature alloc
only.
impl<S: Spec> From<Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
alloc
only.source§fn from(v: Normalized<'_, RiAbsoluteStr<S>>) -> Self
fn from(v: Normalized<'_, RiAbsoluteStr<S>>) -> Self
source§impl<S: Spec> From<Normalized<'_, RiStr<S>>> for RiString<S>
Available on crate feature alloc
only.
impl<S: Spec> From<Normalized<'_, RiStr<S>>> for RiString<S>
alloc
only.source§fn from(v: Normalized<'_, RiStr<S>>) -> Self
fn from(v: Normalized<'_, RiStr<S>>) -> Self
source§impl<S: Spec> ToDedicatedString for Normalized<'_, RiAbsoluteStr<S>>
Available on crate feature alloc
only.
impl<S: Spec> ToDedicatedString for Normalized<'_, RiAbsoluteStr<S>>
alloc
only.source§type Target = RiAbsoluteString<S>
type Target = RiAbsoluteString<S>
source§fn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
fn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
source§fn to_dedicated_string(&self) -> Self::Target
fn to_dedicated_string(&self) -> Self::Target
source§impl<S: Spec> ToDedicatedString for Normalized<'_, RiStr<S>>
Available on crate feature alloc
only.
impl<S: Spec> ToDedicatedString for Normalized<'_, RiStr<S>>
alloc
only.source§fn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
fn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
source§fn to_dedicated_string(&self) -> Self::Target
fn to_dedicated_string(&self) -> Self::Target
Auto Trait Implementations§
impl<'a, T> Freeze for Normalized<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for Normalized<'a, T>where
T: ?Sized,
impl<'a, T> Send for Normalized<'a, T>where
T: ?Sized,
impl<'a, T> Sync for Normalized<'a, T>where
T: ?Sized,
impl<'a, T> Unpin for Normalized<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for Normalized<'a, T>where
T: ?Sized,
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
source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
source§fn try_to_string(&self) -> Result<String, TryReserveError>
Available on crate feature alloc
only.
fn try_to_string(&self) -> Result<String, TryReserveError>
alloc
only.ToString::to_string
, but without panic on OOM.