pub struct ExtValue<'a>(pub &'a str);Expand description
A logical string wrapped for use as an RFC 8187 ext-value, in header parameters like
Content-Disposition’s filename*.
The string is escaped lazily as this is displayed, so a caller can write it straight into a
header it is already building instead of allocating an intermediate string. The output includes
the charset prefix, so it goes directly after the = of a header parameter.
Unlike encode_header_value, this escapes everything outside a narrow attr-char set,
because an ext-value sits inside a header parameter rather than spanning a whole value.
§Examples
use objectstore_types::headers::ExtValue;
assert_eq!(ExtValue("réport.pdf").to_string(), "UTF-8''r%C3%A9port.pdf");Tuple Fields§
§0: &'a strTrait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ExtValue<'a>
impl<'a> RefUnwindSafe for ExtValue<'a>
impl<'a> Send for ExtValue<'a>
impl<'a> Sync for ExtValue<'a>
impl<'a> Unpin for ExtValue<'a>
impl<'a> UnsafeUnpin for ExtValue<'a>
impl<'a> UnwindSafe for ExtValue<'a>
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