Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 20 10:27
    paulzhang5511 synchronize #347
  • Aug 20 03:53
    paulzhang5511 synchronize #347
  • Aug 20 03:36
    paulzhang5511 synchronize #347
  • Aug 20 03:33
    paulzhang5511 synchronize #347
  • Aug 20 03:01
    paulzhang5511 edited #347
  • Aug 20 02:50
    paulzhang5511 synchronize #347
  • Aug 16 02:01
    paulzhang5511 commented #114
  • Aug 15 11:49
    paulzhang5511 synchronize #347
  • Aug 15 07:41
    paulzhang5511 synchronize #347
  • Aug 15 07:02
    paulzhang5511 opened #347
  • Aug 14 07:55
    dependabot-preview[bot] labeled #346
  • Aug 14 07:55
    dependabot-preview[bot] opened #346
  • Aug 14 07:55

    dependabot-preview[bot] on cargo

    Update syn requirement from 0.1… (compare)

  • Aug 14 07:55
    dependabot-preview[bot] labeled #345
  • Aug 14 07:55
    dependabot-preview[bot] opened #345
  • Aug 14 07:55

    dependabot-preview[bot] on cargo

    Update quote requirement from 0… (compare)

  • Aug 13 00:56

    dependabot-preview[bot] on cargo

    (compare)

  • Aug 13 00:56

    colinbankier on master

    Update nix requirement from 0.1… Merge pull request #343 from go… (compare)

  • Aug 13 00:56
    colinbankier closed #343
  • Aug 12 17:11
    ernestas-poskus closed #342
Benjamin Quinn
@Blquinn
Ah, ok, got it! Thanks for the clarification!
Isaac Whitfield
@whitfin
Yeah, I noticed that recently. Looked like the Hyper, Gotham and Thruster builds all started failing due to a Rust issue as they were using 1.29. I filed a PR to fix them all, and as @64 says they'll be in the next batch of results.
If anyone gets time, here's a one-liner for a stupid bug in the CookieParser: gotham-rs/gotham#331
Colin Bankier
@colinbankier
A fix for the CI failures on master: gotham-rs/gotham#332
Colin Bankier
@colinbankier
@secretfader - any chance you can add @nyarly @whitfin and myself as owners of https://crates.io/crates/gotham_middleware_jwt, so we can publish a new version?
Christian Höppner
@mkaito
Hi! Do I need to fetch the diesel middleware from git to use right now? doesn't seem to be on crates.io
Colin Bankier
@colinbankier
Hi @mkaito - yes, we have been a little delayed in publishing this to crates.io with the recent release. Specifying it as a git dependency is the best way for now - let us know if you have issues with this. It should be published soon :)
Christian Höppner
@mkaito
Took me a while to figure out that I was supposed to point at the 0.4-maint branch. Pointing cargo at master didn't work. That should allow me to work on things until you get around to updating cratres.io
in case it matters, middleware_diesel was complaining it couldn't find gotham 0.5-dev. Not really sure why. All the gotham pieces were pointed at the same git remote.
Colin Bankier
@colinbankier
@mkaito - sorry for the hoops you had to jump through there. I have now published the diesel middleware to crates.io https://crates.io/crates/gotham_middleware_diesel

This is compatible with the 0.4.0 gotham release. e.g.

gotham = "0.4.0"
gotham_middleware_diesel = "0.1.0"

in your dependencies should now just work.
We are rethinking better ways to include / publish middlewares to ease this burden of dependencies between (built-in) middlewares and gotham in the near future.

Chris Allen
@bitemyapp
I'm trying to dig up an explanation of the (State, Response-y'thingy) return type in handlers. I'm coming from Actix/Warp where I'm accustomed to things being Result shaped. Does anyone know where I could find such an explanation? Gonna keep digging through docs meanwhile.
Isaac Whitfield
@whitfin
I’m on my phone so I can’t link; but the return types always implement IntoHandlerFuture
Chris Allen
@bitemyapp
is it idiomatic/correct to return tuples in Gotham handlers as in the examples?
or is it a weird tutorial'ism?
It can be hard to tell what's a recommendation vs. a tutorialism, usually examples don't really call that out. the generic handler macro comes to mind.
type HandlerFuture = dyn Future<Item = (State, Response<Body>), Error = (State, HandlerError)> + Send;
I'll look around for error handling examples, see if I'm meant to use early return or ? for error handling
Chris Allen
@bitemyapp
I'm assuming that if I just impl Response trait thingy in the right hand side of the tuple and early-return errors and successes the types will conflict
Isaac Whitfield
@whitfin
Returning anything implementing that trait is "correct", none are better than the others - it's just easier to get started with the Tuple form. You don't have to use that if you'd like to chain some future, for example.
Iivari Äikäs
@orva
This might be really silly question, but is there easy way to find exactly what data can be borrowed from state? Other than reading the source, of course
Currently I just dig into examples to get knowledge how to be able access headers for example
Chris Allen
@bitemyapp
Iivari Äikäs
@orva
Thanks! Don't know how I missed that impl list when I looked StateData documentation.. :pensive:
Chris Allen
@bitemyapp
S'no problem. I find it a little hard to navigate trait-heavy APIs too.
Christian Höppner
@mkaito
@colinbankier thanks for the notice, I hadn't had time to go back and play with gotham again. jwt middleware needs a bump on crates.io as well, as I'm sure you know.
Christer Stenbrenden
@uggwar_gitlab
hey! I'm a bit new to gotham (and rust), but have started writing some services at work and could need some help regarding how to structure my projects. Let's say I have a service I have written and want to use it to return some data from requests; how do I best access this service from within the handlers?
The "service" is just a struct that implements a pub fn query(&str) -> String
Christian Höppner
@mkaito
Did you guys explicitly adopt the Contributor Covenant, or did you just click the Github button?
Judson Lester
@nyarly
Why do you ask?
Christian Höppner
@mkaito
Curiosity
Dennis Mayr
@dennismayr
Hello, I'm new to Rust and recently checked out Gotham.
As templating engines, the documentation shows 2: Tera and Askama.
Can other engines be integrated? (e.g. Handlebars)
Tinh Phan
@tinh-phan
Hello everyone, let me ask if the current project plans to add any new features?
Colin Bankier
@colinbankier
@uggwar_gitlab - it sounds like just want to share your "service" across handlers. Check out the shared state example https://github.com/gotham-rs/gotham/blob/master/examples/shared_state/src/main.rs
I imagine you'd need something similar to this. Let us know if this doesn't look like it gives you what you need.
Colin Bankier
@colinbankier
@dennismayr - there is nothing built into gotham for either of the templating engines shown in examples - it is flexible such that you can use whichever you like. The examples should give you enough clues to use a different one, e.g. Handlebars - but if you get stuck don't hesitate to ask here for help :)
@minhtinh885 - we certainly do plan to continue to add new features, yes :)
We welcome any feature requests or contributions :)
Colin Bankier
@colinbankier

jwt middleware needs a bump on crates.io as well, as I'm sure you know.

Thanks @mkaito - yes, this is an issue. The initial version was published by one of our great community members @secretfader , and then was brought into the main gotham codebase. We're still trying to coordinate with @secretfader to get core contributors access to publish the crate going forward.
Worst case, we could publish with a different name, but wanted to avoid this if possible.

Dennis Mayr
@dennismayr
@colinbankier Thanks for the clarification! I'll experiment with handlebars then
Paul Zhang
@paulzhang5511
@colinbankier How to add header for the test request.
Michael P. Jung
@bikeshedder
I'm giving gotham a try right now and wonder how to implement an async handler function. E.g. I'm using tokio_postgres to fetch some data which gives me a Future<Vec<SomeItem>, tokio_postgres::Error> how can I write a handler function that returns a Future so it becomes async?
Ah, forget it. I just found the async example in the handlers example directory. facepalm
Judson Lester
@nyarly
No problem :)
Colin Bankier
@colinbankier
@paulzhang5511 - I'll take a look at your branch / PR.
Colin Bankier
@colinbankier
@paulzhang5511 - I responded over in your PR at gotham-rs/gotham#347
Colin Bankier
@colinbankier
btw, anyone wanting to use the jwt middleware compatible with the current release, until we get the crates.io issue sorted out (still trying), can just use it like this in your Cargo.toml:
gotham_middleware_jwt = {git = "https://github.com/gotham-rs/gotham", branch = "0.4-maint"}
Paul Zhang
@paulzhang5511
@colinbankier Fixed test and fmt issue.