These are chat archives for rust-lang/rust

11th
May 2018
Kelly Thomas Kline
@kellytk
May 11 2018 06:20
What has your experience been like in using Rust-based configuration management tools such as Realize? (https://github.com/dflemstr/realize) I use Ansible ATM however I think something in Rust could improve upon it
Kevin
@AnaRobynn
May 11 2018 09:23
Hello beautiful people of the Rust community. I've recently feeling some thirst for a static typed language and getting in backend development by creating RESTful api's.
I'm torn between using the language I like Javascript (so Node) or learning a completely new language. Does Rust makes sense for web services?
Michal 'vorner' Vaner
@vorner
May 11 2018 09:36

To an extend. You can expect somehow slower initial development (because Rust doesn't let you do as much dirty stuff and wants you to do it properly before it even compiles), especially while learning it. On the other hand, you get some more confidence in quality of your code and usually better performance. That being said, web services isn't exactly the primary goal of Rust, unless you know you need the performance, and the libraries are young and there are less of them.

So it depends. If you need top performance or it is critical in terms of correctness or you want to have fun learning it, then go ahead with Rust. If you just want to get the thing over with and move onto the next project, probably not.

Sathya Narrayanan
@sourcepirate
May 11 2018 11:36
Does anyone know how do i convert openssh keys to openssl RSA compatible keys .
 ErrorStack([Error { code: 151441516, library: "PEM routines", function: "PEM_read_bio", reason: "no start line", file: "crypto/pem/pem_lib.c", line: 691, data: "Expecting: PUBLIC KEY" }])'
I am using rust-openssl and openssh-keys crates.
let pkey = openssh_keys::PublicKey::from_str(include_str!("key.pub")).unwrap();
        let public_key = Rsa::public_key_from_pem(pkey.to_string().as_bytes()).unwrap();
        let private_key = Rsa::private_key_from_pem(include_bytes!("key.pem")).unwrap();
        let message : String = String::from("hello");
        let mut result : Vec<u8> = vec![0; public_key.size() as usize];
        let _ulen = public_key.public_encrypt(message.as_bytes(), &mut result, Padding::PKCS1).unwrap();
        let mut decrypted_message = vec![0; private_key.size() as usize];
        let glen = private_key.private_decrypt(result.as_slice(), &mut decrypted_message, Padding::PKCS1).unwrap();
        assert_eq!(message.as_bytes(), &decrypted_message[0..glen]);
And that's the code i am trying to run.
Zakarum
@omni-viral
May 11 2018 16:55
Why rustc can't statically guarantee that struct Foo<T>(T) has the same size as T?
Judson Lester
@nyarly
May 11 2018 17:47
I'm getting error[E0514]: found crateborrow_bagcompiled by an incompatible version of rustc
How do I get cargo to rebuild that (in-project) crate?
Just clobber the output dir?
Restioson
@Restioson
May 11 2018 17:56
@omni-viral it should be able to but probably can't unless Foo is #[repr(C)] as rust's ABI is not defined
there's my shot at it
@nyarly you could, but it'd probably be better to do cargo clean. How did this happen?
might be worth a report
Judson Lester
@nyarly
May 11 2018 17:57
I've had the project around for a while and updated Rust in the meantime :shrug:
Kelly Thomas Kline
@kellytk
May 11 2018 20:05
Is https://twitter.com/meteor_saan / Kanzaki Ranko on Gitter? I'd like to chat with them about their Rust-based video distribution server
Zakarum
@omni-viral
May 11 2018 21:22
@Restioson #[repr(C)] doesn't change a thing
Denis Lisov
@tanriol
May 11 2018 21:26
@omni-viral What do you mean by a static guarantee?
Denis Lisov
@tanriol
May 11 2018 21:31
Seems that I see... inability to transmute between them in a generic function?