pub enum Value {
Scalar(String),
Array(Vec<String>),
}Expand description
A query parameter value, either a single string or an array of strings.
§Examples
use hitbox_http::query::{parse, Value};
// Scalar value
let params = parse("name=alice").unwrap();
assert!(matches!(params.get("name"), Some(Value::Scalar(_))));
// Array value (using bracket syntax)
let params = parse("tags[]=rust&tags[]=http").unwrap();
assert!(matches!(params.get("tags"), Some(Value::Array(_))));Variants§
Scalar(String)
A single parameter value.
Array(Vec<String>)
Multiple values for the same parameter (array syntax).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.