popper-rs 0.5.0

A crate for using Popper in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde_json::{Value, json};

#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Offset {
    pub skidding: i32,
    pub distance: i32,
}

impl Offset {
    pub fn to_json(&self) -> Value {
        json!({
            "offset": [self.skidding, self.distance],
        })
    }
}