25 stable releases (5 major)
Uses new Rust 2024
| 6.0.0 | Oct 6, 2025 |
|---|---|
| 5.1.2 | Apr 12, 2024 |
| 4.0.4 | Jun 20, 2023 |
| 4.0.3 | Nov 13, 2022 |
| 1.0.1 | Oct 1, 2022 |
#140 in HTTP client
1,098 downloads per month
Used in wacr
40KB
817 lines
VK API Client
This is a base pure rust implementation of VK API client. The client supports zstd compression and msgpack format of VK API. It's works with http2 only connections.
Supported features
- API requests
- Longpoll
- Upload files
See the library documentation or VK API documentation for more.
Usage
use vkclient::VkApi;
fn main() {
let client: VkApi = vkclient::VkApiBuilder::new(access_token).into();
..
}
use vkclient::{VkApi, VkApiResult, List};
use serde::{Deserialize, Serialize};
async fn get_users_info(client: &VkApi) -> VkApiResult<Vec<UsersGetResponse>> {
client.send_request("users.get", UsersGetRequest {
user_ids: List(vec![1,2]),
fields: List(vec!["id", "sex"]),
}).await
}
#[derive(Serialize)]
struct UsersGetRequest<'a> {
user_ids: List<Vec<usize>>,
fields: List<Vec<&'a str>>,
}
#[derive(Deserialize)]
struct UsersGetResponse {
id: i64,
first_name: String,
last_name: String,
sex: u8,
}
Dependencies
~4–22MB
~260K SLoC