Crates.io | fast_vk |
lib.rs | fast_vk |
version | 0.6.1 |
source | src |
created_at | 2022-09-16 16:10:07.180166 |
updated_at | 2022-10-23 09:25:32.551132 |
description | Relatively low-level VK API library designed for millions requests per second |
homepage | |
repository | https://github.com/kinetus/fast_vk |
max_upload_size | |
id | 667477 |
size | 32,796 |
Library for fast data collection from VK
[dependencies]
fast_vk = "0.5"
use fast_vk::{Client, Instance};
use vk_method::{Method, Params};
#[tokio::main]
async fn main() {
let token = ["1234567890abcdef1234567890abcdef1234567890abcdef"];
let instances = Instance::from_tokens(token).unwrap();
let pool = Client::from_instances(instances);
let mut params = Params::new();
params.insert("user_id", 1);
let response = pool.method(Method::new(
"users.get",
params,
)).await.unwrap();
assert_eq!(
response,
serde_json::json!([
{
"id": 1,
"first_name": "Pavel",
"last_name": "Durov",
"is_closed": false,
"can_access_closed": true
}
])
)
}