#[repr(transparent)]pub struct Encoded<Str>(pub Str);
Expand description
Wrapper type that implements Display
. Encodes on the fly, without allocating.
Percent-encodes every byte except alphanumerics and -
, _
, .
, ~
. Assumes UTF-8 encoding.
use urlencoding::Encoded;
format!("{}", Encoded("hello!"));
Tuple Fields§
§0: Str
Implementations§
Trait Implementations§
source§impl<Str: Ord> Ord for Encoded<Str>
impl<Str: Ord> Ord for Encoded<Str>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<Str: PartialOrd> PartialOrd for Encoded<Str>
impl<Str: PartialOrd> PartialOrd for Encoded<Str>
impl<Str: Copy> Copy for Encoded<Str>
impl<Str: Eq> Eq for Encoded<Str>
impl<Str> StructuralPartialEq for Encoded<Str>
Auto Trait Implementations§
impl<Str> Freeze for Encoded<Str>where
Str: Freeze,
impl<Str> RefUnwindSafe for Encoded<Str>where
Str: RefUnwindSafe,
impl<Str> Send for Encoded<Str>where
Str: Send,
impl<Str> Sync for Encoded<Str>where
Str: Sync,
impl<Str> Unpin for Encoded<Str>where
Str: Unpin,
impl<Str> UnwindSafe for Encoded<Str>where
Str: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)