Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another day, Another session. #272

Closed
wants to merge 18 commits into from

Commits on Sep 7, 2015

  1. feat(server): add some shared data across all requests

    This can be used to add some compile time dependencies for
    Middleware and Plugins.
    
    To fix code broken by this, you will need to introduce a type
    parameter for Request, Response, MiddlewareResult and NickelError.
    
    ```
    // e.g. This
    fn foo<'a>(&mut Request, Response<'a>) -> MiddlewareResult<'a>
    
    // Should become:
    fn foo<'a, D>(&mut Request<D>, Response<'a, D>) -> MiddlewareResult<'a, D>
    ```
    
    You can add bounds to `D` in the above to place compile-time restrictions on
    the server data (can be used for configuration).
    
    BREAKING CHANGE
    Ryman committed Sep 7, 2015
    Configuration menu
    Copy the full SHA
    8e462b3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0a0e43b View commit details
    Browse the repository at this point in the history
  3. feat(response): allow Plugins for Response

    Also adds `on_send` which can be used to execute code
    when the Response headers are being sent.
    Ryman committed Sep 7, 2015
    Configuration menu
    Copy the full SHA
    060e9cc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7ace3fa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fc83ec1 View commit details
    Browse the repository at this point in the history
  6. fix(cookies): add explicit implementations for Cookies trait

    The 1.2 beta has a regression for this kind of code, so being
    explicit should allow us to compile on all targets.
    Ryman committed Sep 7, 2015
    Configuration menu
    Copy the full SHA
    a3e3c26 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b5b1f6f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    07a697d View commit details
    Browse the repository at this point in the history
  9. feat(macros): allow hinting the server data type in middleware macro

    This can sometimes be required when using some middleware which are
    predicated on the datatype of the Server. An alternative would be to
    litter the handler with extra type annotations (which is awkward without
    type ascription), or to use explicit type-annotated functions as middleware.
    
    Example usage:
    ```
    middleware! { |res| <ServerData>
       // res is of type Response<ServerData>
    }
    ```
    Ryman committed Sep 7, 2015
    Configuration menu
    Copy the full SHA
    696b4a1 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3754356 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    45e25d5 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    bf001c2 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8591b8d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    279301e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7def1b3 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    23d1494 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    3a3fc6f View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    7b7742c View commit details
    Browse the repository at this point in the history