pub struct EncodedStr(/* private fields */);Expand description
A percent-encoded string.
Implementations§
Source§impl EncodedStr
impl EncodedStr
Sourcepub unsafe fn new_unchecked(s: &[u8]) -> &EncodedStr
pub unsafe fn new_unchecked(s: &[u8]) -> &EncodedStr
Create a new instance of EncodedStr from an encoded str.
§Safety
The given string must be a percent-encoded sequence.
Sourcepub fn percent_decode(&self) -> Result<Cow<'_, str>, Utf8Error>
pub fn percent_decode(&self) -> Result<Cow<'_, str>, Utf8Error>
Decode this encoded string as an UTF-8 string.
Sourcepub fn percent_decode_lossy(&self) -> Cow<'_, str>
pub fn percent_decode_lossy(&self) -> Cow<'_, str>
Decode this encoded string as an UTF-8 string.
This method will not fail and the invalid UTF-8 characters will be replaced to � (U+FFFD).