These are chat archives for rust-lang/rust

Aug 2018
Kelly Thomas Kline
Aug 01 2018 03:40 UTC
This is an off-topic question; how would you describe the difference between server/client and backend/frontend?
Michal 'vorner' Vaner
Aug 01 2018 07:04 UTC
Server-client is about what entity starts the communication. Frontend/backend is about if someone is looking at the thing. If you have a tor client, it can act as a server too ‒ others can connect to it. If you have an automatic smart building controller that turns on the heating, for example, the thing is a client (it connects to some central authority to coordinate), but isn't visible, so it is not a frontend.
Aug 01 2018 11:35 UTC
I wonder how many essentially equivalent crates out there on
People often make their own crate for doing something simple and publish it instead of searching for one that is already there and do the thing they need.
Denis Lisov
Aug 01 2018 11:36 UTC
And even more incomplete and abandoned ones...
Do Duy
Aug 01 2018 14:51 UTC
Hi, I cannot use unimplemented!() with function that return impl Future, sample code is:
Any idea?
Aug 01 2018 14:52 UTC
@juchiast You need to specify concrete type
Aug 01 2018 14:52 UTC
yeah, impl Trait sort of infers output type for you, but there's nothing to infer out of unimplemented!
Dylan DPC
Aug 01 2018 18:41 UTC
well you code won't always be unimplemented in the future :trollface:

I am confused on how to use 'mod/use' I have:
src/foo/bar/cat/ <-- has """const x = 2"

Now, from, how do I refer to 'x' from foo/bar/cat/ ?


Aug 01 2018 22:47 UTC
mod foo/bar/cat/dog;
and then use foo/bar/cat/dog::*
This is counter intuitive to me. Can you tell me why I am writing foo/bar/cat/dog intead of "foo::bar::cat::dog" which is what I tried
Also, is there a better way to do "while true; do cargo check; done;" ?
Aug 01 2018 22:51 UTC
oh, you mean like that
then it's mod foo; in
and then use foo::bar::cat::dog::*;
but you have to have in every directory after src
that has mod foo; and so on
Having a in every directory seems silly.
I'm new to Rust. What is a good directory structure I can just copy/paste to use as my own ?
Aug 01 2018 22:53 UTC
it's not really intuitive, but you need to say that you have given module at least once in main source tree starting from
just look anything up, any project really
Aug 01 2018 22:54 UTC
I agree that it's not the best combination of convention and syntax.
Aug 01 2018 22:54 UTC
you have some freedom to do modules how you want them, but it's also inconsistent all over the pace as a price :)