pub struct Value<'a>(/* private fields */);
Expand description
A media-type parameter value.
The constructor accepts both an unquoted string and a quoted string like "Hello Wold!"
.
If the string is not quoted, the allowed characters are
alphabets, numbers and !#$&-^_.+%*'
.
let utf8 = Value::new("UTF-8").unwrap();
let utf8_quoted = Value::new("\"UTF-8\"").unwrap();
assert_eq!(utf8, utf8_quoted);
assert_eq!(utf8_quoted.as_str(), "\"UTF-8\"");
assert_eq!(utf8_quoted.unquoted_str(), "UTF-8");
let double_quoted = Value::new("\" \\\" \"").unwrap();
assert_eq!(double_quoted.as_str(), "\" \\\" \"");
assert_eq!(double_quoted.unquoted_str(), " \" ");
Implementations§
Trait Implementations§
source§impl<'a> Ord for Value<'a>
impl<'a> Ord for Value<'a>
source§impl<'a> PartialOrd<&Cow<'_, str>> for Value<'a>
impl<'a> PartialOrd<&Cow<'_, str>> for Value<'a>
source§impl<'a> PartialOrd<&String> for Value<'a>
impl<'a> PartialOrd<&String> for Value<'a>
source§impl<'a> PartialOrd<&str> for Value<'a>
impl<'a> PartialOrd<&str> for Value<'a>
source§impl<'a> PartialOrd<Cow<'_, str>> for Value<'a>
impl<'a> PartialOrd<Cow<'_, str>> for Value<'a>
source§impl<'a> PartialOrd<String> for Value<'a>
impl<'a> PartialOrd<String> for Value<'a>
source§impl<'a> PartialOrd<str> for Value<'a>
impl<'a> PartialOrd<str> for Value<'a>
source§impl<'a> PartialOrd for Value<'a>
impl<'a> PartialOrd for Value<'a>
impl<'a> Copy for Value<'a>
impl<'a> Eq for Value<'a>
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnwindSafe for Value<'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
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
)