fast_vk

Crates.iofast_vk
lib.rsfast_vk
version0.6.1
sourcesrc
created_at2022-09-16 16:10:07.180166
updated_at2022-10-23 09:25:32.551132
descriptionRelatively low-level VK API library designed for millions requests per second
homepage
repositoryhttps://github.com/kinetus/fast_vk
max_upload_size
id667477
size32,796
Eduard Baturin (Trard)

documentation

https://docs.rs/fast_vk

README

Fast VK 🚀

Library for fast data collection from VK

[dependencies]
fast_vk = "0.5"

Example

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
            }
        ])
    )
}
Commit count: 204

cargo fmt