safe-vk 0.3.3-alpha

A simple library to create your own vk bot for conversations
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod ctx;
mod keyboard;
mod state;

use crate::RequestBuilder;
use std::{future::Future, sync::Arc};

pub use self::{ctx::Ctx, keyboard::Keyboard, state::State};

pub type Update<T = serde_json::Value> = crate::responses::Event<T>;

pub trait FromUpdate<S>: Sized {
    fn from_update(
        update: Update,
        state: &S,
        request: Arc<RequestBuilder>,
    ) -> impl Future<Output = Result<Self, ()>> + Send;
}