pub struct Parameter {
pub key: String,
pub value: String,
/* private fields */
}Expand description
A single query parameter for a parameterized Dune query.
The parameter name must match the name defined in the query on Dune (e.g. in the query editor).
Use the constructors Parameter::text, Parameter::number, Parameter::date, and
Parameter::list to build parameters of the correct type.
§Example
use duners::Parameter;
use chrono::Utc;
let params = vec![
Parameter::text("WalletAddress", "0x1234..."),
Parameter::number("MinAmount", "100"),
Parameter::list("Token", "ETH"),
Parameter::date("StartDate", Utc::now()),
];Fields§
§key: StringParameter name (must match the query’s parameter name on Dune).
value: StringString value sent to the API.
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn date(name: &str, value: DateTime<Utc>) -> Self
pub fn date(name: &str, value: DateTime<Utc>) -> Self
Builds a date parameter. The value is sent as YYYY-MM-DD HH:MM:SS.
Sourcepub fn text(name: &str, value: &str) -> Self
pub fn text(name: &str, value: &str) -> Self
Builds a text parameter (e.g. addresses, hashes, plain strings).
Trait Implementations§
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnwindSafe for Parameter
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