#[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