Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Diekmann <[email protected]>
  • Loading branch information
indietyp and TimDiekmann authored Oct 7, 2024
1 parent f1ff468 commit d5628dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/@local/harpc/server/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub struct Handler<S> {
/// the meta information (service id and version) and the actual handler. Unlike [`Steer`], it also
/// doesn't require `&mut self` access, which allows for more granular cloning.
///
/// # Design motivations
///
/// The reason why we essentially require `Clone`/`Copy` for the handlers is that once the route is
/// constructed it needs to be available for each request that happens, now, there are multiple ways
/// to achieve this.
Expand All @@ -56,7 +58,7 @@ pub struct Handler<S> {
/// it isn't strictly needed), as well as the use of sessions. To store any information across
/// calls, one must make use of smart pointers, such as `Arc`.
///
/// [`Steer`]: https://docs.rs/tower/latest/tower/steer/struct.Steer.html
/// [`Steer`]: tower::steer::Steer
pub trait Route<B, C> {
type ResponseBodyError;
type Future: Future<Output = BoxedResponse<Self::ResponseBodyError>> + Send;
Expand Down

0 comments on commit d5628dd

Please sign in to comment.