These are chat archives for rust-lang/rust

1st
Aug 2018
Kelly Thomas Kline
@kellytk
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
@vorner
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.
Zakarum
@omni-viral
Aug 01 2018 11:35 UTC
I wonder how many essentially equivalent crates out there on crates.io
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
@tanriol
Aug 01 2018 11:36 UTC
And even more incomplete and abandoned ones...
Do Duy
@juchiast
Aug 01 2018 14:51 UTC
Hi, I cannot use unimplemented!() with function that return impl Future, sample code is: https://play.rust-lang.org/?gist=a73d4e38bb22bae7a61349a9b8804595&version=stable&mode=debug&edition=2015
Any idea?
Zakarum
@omni-viral
Aug 01 2018 14:52 UTC
@juchiast You need to specify concrete type
Dmitriy
@dpogretskiy
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
@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/main.rs
src/foo/bar/cat/dog.rs <-- has """const x = 2"

Now, from main.rs, how do I refer to 'x' from foo/bar/cat/dog.rs ?

```

Dmitriy
@dpogretskiy
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;" ?
Dmitriy
@dpogretskiy
Aug 01 2018 22:51 UTC
oh, you mean like that
then it's mod foo; in main.rs
and then use foo::bar::cat::dog::*;
but you have to have mod.rs in every directory after src
that has mod foo; and so on
Having a mod.rs 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 ?
Dmitriy
@dpogretskiy
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 main.rs/lib.rs
just look anything up, any project really
Ichoran
@Ichoran
Aug 01 2018 22:54 UTC
I agree that it's not the best combination of convention and syntax.
Dmitriy
@dpogretskiy
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 :)