lisk_api_rust_client/api/
voters.rs

1use http::client::Client;
2use std::borrow::Borrow;
3
4use api::models::DelegateWithVoters;
5use api::Result;
6
7pub struct Voters {
8    client: Client,
9}
10
11impl Voters {
12    pub fn new(client: Client) -> Voters {
13        Voters { client }
14    }
15
16    pub fn all(&self) -> Result<DelegateWithVoters> {
17        self.all_params(Vec::<(String, String)>::new())
18    }
19
20    pub fn all_params<I, K, V>(&self, parameters: I) -> Result<DelegateWithVoters>
21    where
22        I: IntoIterator,
23        I::Item: Borrow<(K, V)>,
24        K: AsRef<str>,
25        V: AsRef<str>,
26    {
27        self.client.get_with_params("voters", parameters)
28    }
29}