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 Ord for Value<'_>
impl Ord for Value<'_>
Source§impl PartialOrd<&Cow<'_, str>> for Value<'_>
impl PartialOrd<&Cow<'_, str>> for Value<'_>
Source§impl PartialOrd<&String> for Value<'_>
impl PartialOrd<&String> for Value<'_>
Source§impl PartialOrd<&str> for Value<'_>
impl PartialOrd<&str> for Value<'_>
Source§impl PartialOrd<Cow<'_, str>> for Value<'_>
impl PartialOrd<Cow<'_, str>> for Value<'_>
Source§impl PartialOrd<String> for Value<'_>
impl PartialOrd<String> for Value<'_>
Source§impl PartialOrd<str> for Value<'_>
impl PartialOrd<str> for Value<'_>
Source§impl PartialOrd for Value<'_>
impl PartialOrd for Value<'_>
impl<'a> Copy for Value<'a>
impl Eq for Value<'_>
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