pub struct Params { /* private fields */ }
Expand description
How to specify API parameters
API parameters can be specified in a number of different ways.
All the functions are typed to accept Into<Params>
, so as long
as it can be converted into Params
.
let _: Params = HashMap::from([("action", "query"), ("titles", "Main Page")]).into();
let _: Params = (&HashMap::from([("action", "query"), ("titles", "Main Page")])).into();
let _: Params = BTreeMap::from([("action", "query"), ("titles", "Main Page")]).into();
let _: Params = [("action", "query"), ("titles", "Main Page")].into();
let _: Params = vec![("action", "query"), ("titles", "Main Page")].into();
See the various From
implementations below for a complete list.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)