safe-vk 1.2.2

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
use crate::{Error, Result};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug)]
pub struct EventAnswer(i8);

impl EventAnswer {
    pub fn get_status(&self) -> Result<i8> {
        let status = self.0;
        match status {
            1 => Ok(status),
            _ => Err(Error::EventAnswerUnkownStatus { status }),
        }
    }
}