HN user

maowtm

27 karma

A programmer known for absolutely nothing.

Keybase: maowtm Lb2B5H4X_UyUvEGWwL_qlFylPHkc19PxggTgwroR7Ak

Posts7
Comments12
View on HN
Updates to H-1B 2 years ago

Not the UK at least, as someone who has done a completely in-country switch from student to skilled worker. In fact you are not allowed to leave the country when your application is in progress (leaving would cancel it).

Rust works pretty well with C, and you could use cbindgen[0] to generate c headers for rust functions marked as extern and it would work when linked together. However, rustls doesn't seems to be providing any such function. Most of its API is rust-based, using stuff that isn't directly available in C (Option, Vec, etc.). So you would have to write at least some rust code that calls the library, and have your C code calls the rust code that you write.

On the flip side, calling C code in rust is pretty easy - you have the entire libc available, and rust-bindgen[1] generate bindings for you, which in my experience works very well. So, you may also consider writing your program in rust… If that's possible.

  [0]: https://github.com/eqrion/cbindgen
  [1]: https://github.com/rust-lang/rust-bindgen