Skip to main content

JSONResponseCode

Trait JSONResponseCode 

Source
pub trait JSONResponseCode {
    // Required method
    fn get_code(&self) -> i32;
}
Expand description

The code of your JSON response.

Required Methods§

Source

fn get_code(&self) -> i32

Assume the code 0 means OK. You can define other codes by yourself. This method will be called for one time when the response is being triggered. You can do something (perhaps keep a log?) at the moment.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl JSONResponseCode for i8

Source§

fn get_code(&self) -> i32

Source§

impl JSONResponseCode for i16

Source§

fn get_code(&self) -> i32

Source§

impl JSONResponseCode for i32

Source§

fn get_code(&self) -> i32

Source§

impl JSONResponseCode for u8

Source§

fn get_code(&self) -> i32

Source§

impl JSONResponseCode for u16

Source§

fn get_code(&self) -> i32

Source§

impl JSONResponseCode for u32

Source§

fn get_code(&self) -> i32

Implementors§