pub struct Params { /* private fields */ }Expand description
Extra exchange-specific parameters for a unified call.
Build with Params::new and the with_* setters, or Params::none
when a method needs no extras. Cheap to clone and Default-constructible.
Implementations§
Source§impl Params
impl Params
Sourcepub fn none() -> Self
pub fn none() -> Self
An empty parameter set — reads better at a call site than
Params::new() when you are explicitly passing “no extras”.
Sourcepub fn with_float(self, key: &str, value: f64) -> Self
pub fn with_float(self, key: &str, value: f64) -> Self
Set a floating-point parameter.
Sourcepub fn with_strs(self, key: &str, values: &[&str]) -> Self
pub fn with_strs(self, key: &str, values: &[&str]) -> Self
Set a list-of-strings parameter (e.g. a batch of client order ids).
Sourcepub fn with_json(self, key: &str, json: &str) -> Self
pub fn with_json(self, key: &str, json: &str) -> Self
Set a nested parameter from a JSON literal, for the rare venue that wants a structured object. Invalid JSON is stored as a plain string.
Sourcepub fn with_params(self, key: &str, value: Params) -> Self
pub fn with_params(self, key: &str, value: Params) -> Self
Set a nested object from another Params. Calling this twice with the
same key MERGES — the second call adds to the object rather than
replacing it.
Sourcepub fn into_value_object(self) -> Value
pub fn into_value_object(self) -> Value
Like Params::into_value but an empty set stays an empty object
rather than collapsing to Value::Null — used when nesting, where the
key should still exist.
Sourcepub fn into_value(self) -> Value
pub fn into_value(self) -> Value
Lower to the dynamic representation the transpiled core consumes.
An empty set becomes Value::Null, which every unified method treats
as “no extra params”.
Trait Implementations§
Source§impl From<Value> for Params
Back-compat: existing call sites that already hold a Value (including
Value::Null) keep working without a conversion at the call site.
impl From<Value> for Params
Back-compat: existing call sites that already hold a Value (including
Value::Null) keep working without a conversion at the call site.