Struct iri_string::normalize::Normalized
source · [−]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
sourceimpl<'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
sourceimpl<T: ?Sized> Debug for Normalized<'_, T>
impl<T: ?Sized> Debug for Normalized<'_, T>
sourceimpl<S: Spec> Display for Normalized<'_, RiAbsoluteStr<S>>
impl<S: Spec> Display for Normalized<'_, RiAbsoluteStr<S>>
sourceimpl<S: Spec> Display for Normalized<'_, RiStr<S>>
impl<S: Spec> Display for Normalized<'_, RiStr<S>>
sourceimpl<S: Spec> From<&Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
impl<S: Spec> From<&Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
sourcefn from(v: &Normalized<'_, RiAbsoluteStr<S>>) -> Self
fn from(v: &Normalized<'_, RiAbsoluteStr<S>>) -> Self
Converts to this type from the input type.
sourceimpl<S: Spec> From<&Normalized<'_, RiStr<S>>> for RiString<S>
impl<S: Spec> From<&Normalized<'_, RiStr<S>>> for RiString<S>
sourcefn from(v: &Normalized<'_, RiStr<S>>) -> Self
fn from(v: &Normalized<'_, RiStr<S>>) -> Self
Converts to this type from the input type.
sourceimpl<S: Spec> From<Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
impl<S: Spec> From<Normalized<'_, RiAbsoluteStr<S>>> for RiAbsoluteString<S>
sourcefn from(v: Normalized<'_, RiAbsoluteStr<S>>) -> Self
fn from(v: Normalized<'_, RiAbsoluteStr<S>>) -> Self
Converts to this type from the input type.
sourceimpl<S: Spec> From<Normalized<'_, RiStr<S>>> for RiString<S>
impl<S: Spec> From<Normalized<'_, RiStr<S>>> for RiString<S>
sourcefn from(v: Normalized<'_, RiStr<S>>) -> Self
fn from(v: Normalized<'_, RiStr<S>>) -> Self
Converts to this type from the input type.
sourceimpl<S: Spec> ToDedicatedString for Normalized<'_, RiAbsoluteStr<S>>
impl<S: Spec> ToDedicatedString for Normalized<'_, RiAbsoluteStr<S>>
sourcefn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
fn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
alloc
only.Converts the value to the allocated string.
sourcefn to_dedicated_string(&self) -> Self::Target
fn to_dedicated_string(&self) -> Self::Target
alloc
only.Converts the value to the allocated string. Read more
sourceimpl<S: Spec> ToDedicatedString for Normalized<'_, RiStr<S>>
impl<S: Spec> ToDedicatedString for Normalized<'_, RiStr<S>>
sourcefn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
fn try_to_dedicated_string(&self) -> Result<Self::Target, TryReserveError>
alloc
only.Converts the value to the allocated string.
sourcefn to_dedicated_string(&self) -> Self::Target
fn to_dedicated_string(&self) -> Self::Target
alloc
only.Converts the value to the allocated string. Read more
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for Normalized<'a, T>
impl<'a, T: ?Sized> Send for Normalized<'a, T>
impl<'a, T: ?Sized> Sync for Normalized<'a, T>
impl<'a, T: ?Sized> Unpin for Normalized<'a, T>
impl<'a, T: ?Sized> UnwindSafe for Normalized<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
sourcefn 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.