feat(server): add const_service and service_fn helpers
				
					
				
			- `const_service` creates a `NewService` that clones references to the wrapped service. - `service_fn` creates a `Service` from a function. Useful with closures.
This commit is contained in:
		| @@ -7,6 +7,7 @@ | ||||
| mod compat_impl; | ||||
| #[cfg(feature = "compat")] | ||||
| pub mod compat; | ||||
| mod service; | ||||
|  | ||||
| use std::cell::RefCell; | ||||
| use std::fmt; | ||||
| @@ -46,6 +47,8 @@ feat_server_proto! { | ||||
|     }; | ||||
| } | ||||
|  | ||||
| pub use self::service::{const_service, service_fn}; | ||||
|  | ||||
| /// An instance of the HTTP protocol, and implementation of tokio-proto's | ||||
| /// `ServerProto` trait. | ||||
| /// | ||||
|   | ||||
		Reference in New Issue
	
	Block a user