- Remove
chrono
optional dependency and bumpuuid
dependency to "1".
- Add
Unknown
andBinary
types. The former corresponds tounknown
in TypeScript, and the latter probably corresponds toBlob
(depending on your environment) but is a sort-fo special case that can be useful to support.
- Update to 2021 edition.
- impl
ApiBody
forserde_json::Map<String,T>
andserde_json::Number
. - ensure Seamless points to its re-export of
serde
in the macro so thatserde
not a required dep in projects using Seamless.
- Accept request bodies which are
futures::AsyncRead + Send + Unpin
rather thanVec<u8>
to allow streaming data into seamless endpoints. Code passing inVec<u8>
can be trivially updated to instead takeseamless::handler::request::Bytes::from_vec(body)
, although optimally you'd make better use of the new streaming capabilities if interested in doing so. - Introduce supporting code for the above, as well as a
Capped
struct which can wrap things likeFromJson
to impose request body byte limits (using const generics) on specific endpoints.
- Fix bug which made it hard to return a valid value from a handler function that didn't accept a body.
- Minor doc fix.
handler::body::Json
andhandler::body::Binary
renamed tohandler::body::FromJson
andhandler::body::FromBinary
.handler::response::HandlerResponse
altered so that it is in a better state to be implemented by others, and takes on more of the responsibility of deciding what the response should look like (no hardcoded JSON assumption any more).- Handlers can now return anything implementing
handler::response::HandlerResponse
(sync or async).
- Require 'content-type: application/json' when requestion a
Json<_>
body in a handler. - Add more documentation around integrating, and more doc improvements.
- Document getting API info. No breaking changes.
RequestParam
andRequestBody
renamed toHandlerParam
andHandlerBody
, and their methods renamed following a similar convention.- Handler functions can now be either async or non-async, and return
Result
s orOption
s. - Doc and example improvements around state.
- Rename
RequestParam
'sget_param
torequest_param
. - A couple of minor tweaks and trait impls.
- Add more documentation.
- Rename and move things around so that they hopefully make more sense (see examples and such for specifics).
- Remove the dependency on
ApiError
from various traits. - Tidy up export hierarchy.
- Allow the expected HTTP method for a route to be configured by implementors of the
Body
trait. (previously it was always POST if aBody
was provided, else GET). - Remove
IntoApiError
and implementFrom<T>
as appropriate instead. - Remove
Method
enum and usehttp::method::Method
in its place.
Improve on the crate documentation.
Initial release to get the ball rolling.