Skip to content

web.response #

fn new_data_response #

pub fn new_data_response[T](data T) Response[T]

new_data_response[T] constructs a new Response<T> object with the given data & an empty message field.

fn new_full_response #

pub fn new_full_response[T](message string, data T) Response[T]

new_full_response[T] constructs a new Response<T> object with the given message & data.

fn new_response #

pub fn new_response(message string) Response[string]

new_response constructs a new Response<String> object with the given message & an empty data field.

struct Response #

pub struct Response[T] {
pub:
	message string
	data    T
}