Commit Graph

7 Commits

Author SHA1 Message Date
Carl Lerche acda5a75b9
Initial introduction of tower-service-util (#193) 2019-03-14 11:27:36 -07:00
Carl Lerche fb01af2ad9
filter: Update error style (#178)
This patch does not migrate tower-filter to use an error type of
Box<Error>. Instead, it defines a new type that optionally contains
a Box<Error>.

The filter layer can be used as part of routing. The router would
sequentially attempt to dispatch a request to an inner service. If
the request is rejected, it attempts the next one. In this case, allocating
a Box<Error> for each attempt is not great.

This strategy still fits within the greater picture. tower_filter::error::Error
implements the error trait, which means that all other layers that take
T: Into<Error> will still work with Filter. Also, only the immediate caller
of Filter should care about rejection errors. In which case, Filter will be
referenced explicitly.

Refs: #131
2019-03-01 15:25:21 -08:00
Carl Lerche bf8c3b885a
mock: Use Box<Error> instead of a generic (#177)
Refs: #131
2019-03-01 13:56:57 -08:00
David Barsky d7e1b8f5dd Format tower with rustfmt; check in CI (#157) 2019-02-11 15:11:31 -08:00
Sean McArthur 787c10b7c4 move Service::ready() to ServiceExt::ready() (#128) 2018-11-27 12:25:59 -08:00
Carl Lerche 5369879af6
Extract `Service` trait and related into crate. (#67)
This makes the `tower` crate available to be a "batteries included"
facade.
2018-04-25 12:35:52 -07:00
Carl Lerche b45c7ee0d4 Add middleware 2017-10-03 10:03:14 -07:00