These are chat archives for rust-lang/rust

2nd
Oct 2016
mhsjlw
@mhsjlw
Oct 02 2016 00:17 UTC
on the topic of http, any good libraries for TCP communication? preferably something that scales well?
simplicity would be nice as well :D
Adrian Utrilla
@autrilla
Oct 02 2016 03:11 UTC
@mhsjlw tokio-core has sockets built on top of futures-rs
wrt simplicity... you'll have to learn about futures-rs if you haven't already!
Robert Stone
@rjstone
Oct 02 2016 03:21 UTC
how is a future different than a promise?
Bradley Weston
@bweston92
Oct 02 2016 08:23 UTC
Oh man I guessed cargo init aha. Now to RTFM aha
Bradley Weston
@bweston92
Oct 02 2016 09:45 UTC
If only Cargo was as smooth as you'd said :(
error: native library `openssl` is being linked to by more than one version of the same package, but it can only be linked once; try updating or pinning your dependencies to ensure that this package only shows up once
How is this fixable? I tried telling Cargo to lock in openssl 0.7 but same error
Cargo.toml
[dependencies]
amqp = "0.0.19"
smtp = "0.3.0"
hyper = "0.9.10"
openssl = "0.7.0"
openssl-sys = "0.7.17"
Jonas Platte
@jplatte
Oct 02 2016 09:58 UTC
@bweston92 Pretty sure that's not how you lock the openssl version. I think you'd usually set the version via Cargo.lock, but unfortunately I can't find any documentation about that. You could try "=0.7.0" as the openssl version in Cargo.tml, maybe that already fixes it.
If you want to find out which crate requires an older version of openssl (as the long-term solution would be to update the dependency there), you can cargo install cargo-edit and then run cargo list --tree in your project directory.
Denis Lisov
@tanriol
Oct 02 2016 10:00 UTC
smtp depends on openssl 0.6, so cargo pulls in both 0.7 and 0.6 branches
Jonas Platte
@jplatte
Oct 02 2016 10:01 UTC
Haha and lettre which is the most downloaded smtp library wants to have openssl 0.8.
So yeah, the two most downloaded smtp libraries require openssl 0.6 or 0.8, amqp and hyper want 0.7. That's annoying.
Denis Lisov
@tanriol
Oct 02 2016 10:04 UTC
...however, openssl 0.8 is compatible with 0.7 as it uses openssl-sys 0.7
Jonas Platte
@jplatte
Oct 02 2016 10:05 UTC
Ah, okay. That solves the issue then :)
Denis Lisov
@tanriol
Oct 02 2016 10:06 UTC
By the way, it seems that lettre is a rebranded version of smtp.
Jonas Platte
@jplatte
Oct 02 2016 10:07 UTC
Oh right. The repository link on crates.io points to the lettre repo.
Although they should really change its descriptions..
Bradley Weston
@bweston92
Oct 02 2016 10:29 UTC
@jplatte ok, didn't really understand what "pin"ning was however @autrilla just sent me a link so will read up on it
Jonas Platte
@jplatte
Oct 02 2016 10:30 UTC
@bweston92 You shouldn't need to. Switching from lettre, the successor of smtp, should fix your problem. Although I guess it can be helpful to know anyway.
Bradley Weston
@bweston92
Oct 02 2016 10:30 UTC
Ok it works with lettre = "0.6.0"
Jonas Platte
@jplatte
Oct 02 2016 10:30 UTC
Nice :)
Bradley Weston
@bweston92
Oct 02 2016 10:31 UTC
Wow Rust is different :|
Jonas Platte
@jplatte
Oct 02 2016 10:31 UTC
Haha, you mean syntax-wise?
Bradley Weston
@bweston92
Oct 02 2016 10:31 UTC
I was hoping to have this service done by end of day
And yes aha! :p
Jonas Platte
@jplatte
Oct 02 2016 10:32 UTC
Also, you probably shouldn't have openssl-sys in your Cargo.toml as I imagine you're not using it directly in your code. The same might apply to openssl.
Bradley Weston
@bweston92
Oct 02 2016 10:32 UTC
Nope, I thought that was the "pin"ning concept
Jonas Platte
@jplatte
Oct 02 2016 10:32 UTC
alright, just wanted to make sure you wouldn't leave them in there to potentially cause future problems ^^
Bradley Weston
@bweston92
Oct 02 2016 10:33 UTC
Nah :p
Crates might was to devalue abandonware?
Rather then giving it top result :p
Jonas Platte
@jplatte
Oct 02 2016 10:39 UTC

Crates might was to devalue abandonware?

What?

I have no idea what you're asking there.
Bradley Weston
@bweston92
Oct 02 2016 10:40 UTC
When I did a search for "smtp" it brought up the package which you said was abandoned first
Or display that it is abandoned somewhere?
For example see result 2 here: https://packagist.org/search/?q=uuid
Jonas Platte
@jplatte
Oct 02 2016 10:40 UTC
Ohhh, you meant to write might want to :D
Bradley Weston
@bweston92
Oct 02 2016 10:41 UTC
Oh lmfao
Sorry
Does Rust have pointers to pointers?
Manish Goregaokar
@Manishearth
Oct 02 2016 10:44 UTC
sure
&&foo
&mut &mut foo
const const Foo
mut mut Foo
er *const *const Foo
Box<Box<Foo>>
and any mixed combination
Bradley Weston
@bweston92
Oct 02 2016 10:45 UTC
Ah ok, it's just https://doc.rust-lang.org/book/the-stack-and-the-heap.html#arguments-and-borrowing the table in that section doesn't really show that
Manish Goregaokar
@Manishearth
Oct 02 2016 10:45 UTC
though &&mut Foo doesn't work as you'd expect it to
I guess
Bradley Weston
@bweston92
Oct 02 2016 10:45 UTC
I don't even know what mut is yet but I'm guessing mutable aha
Manish Goregaokar
@Manishearth
Oct 02 2016 10:46 UTC
double borrows aren't usually necessary
pointer-to-pointer isn't a commonly used pattern
Jonas Platte
@jplatte
Oct 02 2016 10:46 UTC
Yup, mutable. But I don't think there's any particular intuition everybody would have about that.
Manish Goregaokar
@Manishearth
Oct 02 2016 10:46 UTC
pointer-to-struct-containing-other-pointer is more common
Bradley Weston
@bweston92
Oct 02 2016 10:47 UTC
@Manishearth I wasn't planning on using them I was just trying to figure it out
Manish Goregaokar
@Manishearth
Oct 02 2016 10:47 UTC
yeah
I'm just providing the argument for not including them in the book
they're composable, but this isn't used as often
you'll come across the composability later on
Bradley Weston
@bweston92
Oct 02 2016 10:50 UTC
:)
Robert Stone
@rjstone
Oct 02 2016 17:53 UTC
@jplatte I orirginally thought mut meant mutex locked or something
mhsjlw
@mhsjlw
Oct 02 2016 18:16 UTC
:)