Struct reep::resource_endpoint::ResourceEndpointBuilder [] [src]

pub struct ResourceEndpointBuilder<I: Id + Any, OpP: ParserMiddleware, R: Resource, BoP: ParserMiddleware> { /* fields omitted */ }

The ResourceEndpointBuilder is the only provieded way to create a ResourceEndpoint it will automatikly inject the gicen body parser and options parser in the routs witch need them. Same is true for a IdParser internaly created using Id type provided by the resource

Methods

impl<OpP: OptionParser, R: Resource, BoP: BodyParser<R>> ResourceEndpointBuilder<R::RId, OpP, R, BoP> where
    R::RId: Sync + Send + Any
[src]

create a new ResourceEndpointBuilder The restrictions on the generic types and their Associatvie Types will assure that Resource, Resource Id, IdParser and BodyParser fit together IdIndo is soly used to provide the IdType and a Key Type for accessing it over the reqest.extension typemap.

Check if a handler/Method for givven ResourceMethod is set

Consumes the Builder to Create the final produkt simple implementation for CustomHttpOptions/CustomHttpOptionsList will be added if not provided when building

attach a handler for a given ResourceMethod Depending on the handler the Body, Id and Option Parsers might be injected as BeforeMiddleware

Panic

Panics if a handler was already provided for the Methodd. Use is_method_set to check if you cann't be sure

shorthand for route(ResourceMethod::Create, handler)

shorthand for route(ResourceMethod::List, handler)

shorthand for route(ResourceMethod::Delete, handler)

shorthand for route(ResourceMethod::Replace, handler)

shorthand for route(ResourceMethod::Get, handler)