pub struct ServiceRouteBuilder {
pub router: Router,
}
Expand description
Fluent builder, takes ownership of a Router
while adding routes.
Call build
to move ownership of the route back out.
Fields§
§router: Router
Implementations§
Source§impl ServiceRouteBuilder
impl ServiceRouteBuilder
Sourcepub fn new() -> ServiceRouteBuilder
pub fn new() -> ServiceRouteBuilder
Create a new instance with a Router
with empty routes.
Sourcepub fn get<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>(
self,
route: &str,
service: S,
) -> Result<Self, Error>
pub fn get<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>( self, route: &str, service: S, ) -> Result<Self, Error>
Add a service for Method::Get
at the specified route.
Sourcepub fn post<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>(
self,
route: &str,
service: S,
) -> Result<Self, Error>
pub fn post<S: Service<Request = Request, Response = Response, Error = Error, Future = LuminalFuture> + 'static>( self, route: &str, service: S, ) -> Result<Self, Error>
Add a service for Method::Post
at the specified route.
pub fn fn_builder(self) -> FnRouteBuilder
Auto Trait Implementations§
impl Freeze for ServiceRouteBuilder
impl !RefUnwindSafe for ServiceRouteBuilder
impl !Send for ServiceRouteBuilder
impl !Sync for ServiceRouteBuilder
impl Unpin for ServiceRouteBuilder
impl !UnwindSafe for ServiceRouteBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more