-
Notifications
You must be signed in to change notification settings - Fork 33
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
Tide feature and improved example #94
Conversation
Provide a tide example similar to the other framework examples, with static files and error handling.
Latest tide contains the builder pattern so would be good to include for those too. I seem to be using builder pattern with render more. Here is the code feel free to copy paste. https://github.com/prabirshrestha/rblog/blob/master/src/renderer.rs |
Thanks for the review, @prabirshrestha !
Ah, it's new? So that's why you didn't use it in the code you contributed, I was wondering. Then I'll change the code to use it. |
builder pattern was only introduced in 0.12. My PR was before that version hence didn't include the builder example. |
Tide uses a diffrent flavor of Mime from the other frameworks I have tried. Add support for that.
Since tide provides the http-types crate as And if I do that, it might make sense to move the traits and impls in |
As a separate static file. Includes some refactoring of the static_file handler.
I'm thinking of moving the contents of Is What should the Builder variant of the render methods return? For error handling, it might be better to return an |
Another thing I have realised: the tide framework seems to make it possible to write the response body directly onto the response buffer (the same buffer as the response header is written to) rather than to a separately allocated buffer which is then copied onto the response buffer. I think that is worth some consideration. Followup: Probably not worth doing. For one, that would hide the length of the body from the impelementation, forcing it to either use some extra buffer anyway or fall back to chunked encoding. Also, creating a |
So far, just the http-types feature through the tide reexport.
adding @yoshuawuyts for thoughts on this. I do like +1 for streaming directly to response stream. current PR is already is good state and given it is an example and no one will be taking a dependency on it I don't have strong opinions to make sure we get the apis right now. |
Since tide is still 0.x, it may be good to prepare for breaking changes.
Yes, you are right. Time to stop fiddling with details and merge this. |
@kaj could you release a new version so I can take dependency on the new feature. |
* PR #80 and #94: Support Tide framework by a feature and an example. * PR #91: Update basic examples to edition 2018. * Issue #68, PR #90: Don't eat whitespace after a for loop. * Issue #66, PR #89: Fix parse error for nested braces in expressions. * PR #84: Use std::ascii::escape_default. * PR #87: Provide ToHtml::to_buffer() * Forbid unsafe and undocumented code. * The build is on https://travis-ci.com/kaj/ructe now. * Internal cleanup. Thanks to @Aunmag and @prabirshrestha for reported issues and contributed code.
Provide a tide example similar to the other framework examples, with static files and error handling.