Struct rustless::framework::api::Api [] [src]

pub struct Api {
    pub version: Option<Version>,
    pub prefix: Option<String>,
    pub handlers: ApiHandlers,
    // some fields omitted
}

Fields

version: Option<Version> prefix: Option<String> handlers: ApiHandlers

Methods

impl Api
[src]

fn new() -> Api

fn build<F>(builder: F) -> Api where F: FnOnce(&mut Api)

fn version(&mut self, version: &str, versioning: Versioning)

fn prefix(&mut self, prefix: &str)

fn consumes(&mut self, mimes: Vec<Mime>)

fn produces(&mut self, mimes: Vec<Mime>)

fn error_formatter<F: 'static>(&mut self, formatter: F) where F: Fn(&Error, &Media) -> Option<Response> + Send + Sync

Trait Implementations

impl Send for Api
[src]

impl Node for Api
[src]

fn get_handlers<'a>(&'a self) -> &'a ApiHandlers

fn get_handlers_mut<'a>(&'a mut self) -> &'a mut ApiHandlers

fn get_before<'a>(&'a self) -> &'a Callbacks

fn get_before_mut<'a>(&'a mut self) -> &'a mut Callbacks

fn get_before_validation<'a>(&'a self) -> &'a Callbacks

fn get_before_validation_mut<'a>(&'a mut self) -> &'a mut Callbacks

fn get_after_validation<'a>(&'a self) -> &'a Callbacks

fn get_after_validation_mut<'a>(&'a mut self) -> &'a mut Callbacks

fn get_after<'a>(&'a self) -> &'a Callbacks

fn get_after_mut<'a>(&'a mut self) -> &'a mut Callbacks

fn push_node<'a>(&'a self, _info: &mut CallInfo<'a>)

impl Nesting for Api
[src]

fn mount<H>(&mut self, edp: H) where H: ApiHandler + Send + Sync

fn namespace<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Namespace)

fn group<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Namespace)

fn resource<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Namespace)

fn resources<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Namespace)

fn segment<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Namespace)

fn get<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Endpoint) -> EndpointHandlerPresent

fn post<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Endpoint) -> EndpointHandlerPresent

fn put<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Endpoint) -> EndpointHandlerPresent

fn delete<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Endpoint) -> EndpointHandlerPresent

fn options<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Endpoint) -> EndpointHandlerPresent

fn head<F>(&mut self, path: &str, builder: F) where F: FnOnce(&mut Endpoint) -> EndpointHandlerPresent

fn before<F: 'static>(&mut self, callback: F) where F: for<'a> Fn(&'a mut Client, &JsonValue) -> HandleSuccessResult + Send + Sync

fn before_validation<F: 'static>(&mut self, callback: F) where F: for<'a> Fn(&'a mut Client, &JsonValue) -> HandleSuccessResult + Send + Sync

fn after<F: 'static>(&mut self, callback: F) where F: for<'a> Fn(&'a mut Client, &JsonValue) -> HandleSuccessResult + Send + Sync

fn after_validation<F: 'static>(&mut self, callback: F) where F: for<'a> Fn(&'a mut Client, &JsonValue) -> HandleSuccessResult + Send + Sync

fn call_handlers<'a, 'r>(&'a self, rest_path: &str, params: &mut JsonValue, req: &'r mut Request + 'r, info: &mut CallInfo<'a>) -> HandleResult<Response>

impl ApiHandler for Api
[src]

fn api_call<'a, 'r>(&'a self, rest_path: &str, params: &mut JsonValue, req: &'r mut Request + 'r, info: &mut CallInfo<'a>) -> HandleResult<Response>