1 2 3 4 5 6 7 8 9 10 11 12 13 14
use serde_json::{Value, json}; #[derive(Clone, PartialEq, Eq, Debug, serde::Serialize)] pub struct PreventOverflow { pub padding: i32, } impl PreventOverflow { pub fn to_json(&self) -> Value { json!({ "padding": self.padding, }) } }