Enum fluent_uri::enc::DecodeInPlace
source · pub enum DecodeInPlace<'a> {
Src(View<'a, str>),
Dst(&'a mut [u8]),
}
Expand description
A wrapper of in-place percent-decoded bytes.
This enum is created by the decode_in_place
method on View<EStr>
.
Variants§
Src(View<'a, str>)
No percent-encoded octets are decoded.
Dst(&'a mut [u8])
One or more percent-encoded octets are decoded.
Implementations§
source§impl<'a> DecodeInPlace<'a>
impl<'a> DecodeInPlace<'a>
sourcepub fn into_bytes(self) -> &'a mut [u8] ⓘ
pub fn into_bytes(self) -> &'a mut [u8] ⓘ
Consumes this DecodeInPlace
and yields the underlying decoded bytes.
sourcepub fn into_str_view(self) -> Result<View<'a, str>, (&'a mut [u8], Utf8Error)>
pub fn into_str_view(self) -> Result<View<'a, str>, (&'a mut [u8], Utf8Error)>
Converts the decoded bytes to a View<str>
.
An error along with the decoded bytes is returned if the bytes are not valid UTF-8.
sourcepub fn into_str(self) -> Result<&'a str, (&'a mut [u8], Utf8Error)>
pub fn into_str(self) -> Result<&'a str, (&'a mut [u8], Utf8Error)>
Converts the decoded bytes to a string slice.
An error along with the decoded bytes is returned if the bytes are not valid UTF-8.
sourcepub fn into_string_lossy(self) -> Cow<'a, str>
pub fn into_string_lossy(self) -> Cow<'a, str>
Converts the decoded bytes to a string lossily.