Skip to content

v0.16

Compare
Choose a tag to compare
@kanarus kanarus released this 14 Apr 08:37
· 147 commits to main since this release
1d19ece

Fundamental Changes

Drastically update the fang system

  • Introduce Fang and FangProc, like tower's Layer and Service.
  • Omit doubly-boxed Futures in Fangs or something as possible I can.
  • Remove Ohkami::howl_with and make every fangs to be called for any requests, including Not Found one, that are eaten by a Ohkami they are registered.
  • Provide FangAction for easy impl of Fang

Drastically update the payload system

  • Introduce Payload and PayloadType trait based on serde framework.
  • Remove #[ResponseBody]
  • Update #[Payload] to take an existing type that impls PayloadType.
  • Provide 5 builtin PayloadType: JSON, Text, HTML, Multipart, URLEncoded

Add static dir serving

"/route".Dir("./path/to/dir") creates Dir, that serves all files in ./path/to/dir.

Buildable without rt_*

For ease with developing third-party Fangs, now ohkami can be build without rt_* feature.

More intuitive route matching

In request handling, make route matching independent of registering order in Ohkami.


Internal Changes

More efficient resource handling in request / response

Put large arrays in Box<_>, this doesn't make bench scores worse.