Trait rustdb::Transaction

source ·
pub trait Transaction: Any {
    // Required methods
    fn selected(&mut self, values: &[Value]);
    fn set_error(&mut self, err: String);

    // Provided methods
    fn status_code(&mut self, _code: i64) { ... }
    fn header(&mut self, _name: &str, _value: &str) { ... }
    fn global(&self, _kind: i64) -> i64 { ... }
    fn arg(&mut self, _kind: i64, _name: &str) -> Rc<String> { ... }
    fn file_attr(&mut self, _fnum: i64, _atx: i64) -> Rc<String> { ... }
    fn file_content(&mut self, _fnum: i64) -> Arc<Vec<u8>> { ... }
    fn get_error(&mut self) -> String { ... }
    fn set_extension(&mut self, _ext: Box<dyn Any + Send + Sync>) { ... }
    fn get_extension(&mut self) -> Box<dyn Any + Send + Sync> { ... }
}
Expand description

Input/Output message. Query and Response.

Required Methods§

source

fn selected(&mut self, values: &[Value])

Append SELECT values to response body.

source

fn set_error(&mut self, err: String)

Set the error string.

Provided Methods§

source

fn status_code(&mut self, _code: i64)

STATUSCODE builtin function. sets the response status code.

source

fn header(&mut self, _name: &str, _value: &str)

HEADER builtin function, adds header to response.

source

fn global(&self, _kind: i64) -> i64

GLOBAL builtin function. Used to get request time.

source

fn arg(&mut self, _kind: i64, _name: &str) -> Rc<String>

ARG builtin function. Get path, query parameter, form value or cookie.

source

fn file_attr(&mut self, _fnum: i64, _atx: i64) -> Rc<String>

Get file attribute ( One of name, content_type, file_name )

source

fn file_content(&mut self, _fnum: i64) -> Arc<Vec<u8>>

Get file content.

source

fn get_error(&mut self) -> String

Get the error string.

source

fn set_extension(&mut self, _ext: Box<dyn Any + Send + Sync>)

Set the extension.

source

fn get_extension(&mut self) -> Box<dyn Any + Send + Sync>

Get the extension. Note: this takes ownership, so extension needs to be set afterwards.

Implementors§