pub struct ParamValue<T>{
pub value: T,
pub style: ParamStyle,
}
Expand description
A parameter value with its serialization style
Fields§
§value: T
The parameter value
style: ParamStyle
The serialization style
Implementations§
Source§impl<T> ParamValue<T>
impl<T> ParamValue<T>
Sourcepub fn with_style(value: T, style: ParamStyle) -> Self
pub fn with_style(value: T, style: ParamStyle) -> Self
Create a new parameter value with specified style
Sourcepub fn query_style(&self) -> ParamStyle
pub fn query_style(&self) -> ParamStyle
Get the actual style to use for query parameters
Sourcepub fn path_style(&self) -> ParamStyle
pub fn path_style(&self) -> ParamStyle
Get the actual style to use for path parameters
Sourcepub fn header_style(&self) -> ParamStyle
pub fn header_style(&self) -> ParamStyle
Get the actual style to use for header parameters
Sourcepub fn as_query_value(&self) -> Option<Value>
pub fn as_query_value(&self) -> Option<Value>
Converts the parameter to a JSON value for query string serialization.
Returns None
if the parameter should not be included in the query string.
Sourcepub fn as_header_value(&self) -> Result<Value, ApiClientError>
pub fn as_header_value(&self) -> Result<Value, ApiClientError>
Converts the parameter to a JSON value for header serialization.
Trait Implementations§
Source§impl<T> Clone for ParamValue<T>
impl<T> Clone for ParamValue<T>
Source§fn clone(&self) -> ParamValue<T>
fn clone(&self) -> ParamValue<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Debug for ParamValue<T>
impl<T> Debug for ParamValue<T>
Source§impl<T> From<T> for ParamValue<T>
impl<T> From<T> for ParamValue<T>
Source§impl<T> PartialSchema for ParamValue<T>
impl<T> PartialSchema for ParamValue<T>
Source§impl<T> ToSchema for ParamValue<T>
impl<T> ToSchema for ParamValue<T>
Auto Trait Implementations§
impl<T> Freeze for ParamValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for ParamValue<T>where
T: RefUnwindSafe,
impl<T> Send for ParamValue<T>
impl<T> Sync for ParamValue<T>
impl<T> Unpin for ParamValue<T>where
T: Unpin,
impl<T> UnwindSafe for ParamValue<T>where
T: 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