[][src]Struct rocket_json_response::JSONResponse

pub struct JSONResponse<'a, T: ToJSON = JSONGetTextValue<'a>> { /* fields omitted */ }

To respond JSON data.

The format of JSON data looks like,

{
   code: <integer>,
   data: <json value>
}

Implementations

impl<'a, T: ToJSON> JSONResponse<'a, T>[src]

pub fn ok(data: T) -> Self[src]

pub fn err<K: JSONResponseCode + 'static>(code: K, data: T) -> Self[src]

Trait Implementations

impl<'a, T: ToJSON> Debug for JSONResponse<'a, T>[src]

impl<'a, T: ToJSON> Responder<'a> for JSONResponse<'a, T>[src]

Auto Trait Implementations

impl<'a, T = JSONGetTextValue<'a>> !RefUnwindSafe for JSONResponse<'a, T>

impl<'a, T = JSONGetTextValue<'a>> !Send for JSONResponse<'a, T>

impl<'a, T = JSONGetTextValue<'a>> !Sync for JSONResponse<'a, T>

impl<'a, T> Unpin for JSONResponse<'a, T> where
    T: Unpin

impl<'a, T = JSONGetTextValue<'a>> !UnwindSafe for JSONResponse<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any