To be able to use C library, I need to give a *mut c_char parameter to a function. But I don't find a way to have it from a str. I converted my str to a CStrin
I have this file hierarchy: main.rs protocol/ protocol/mod.rs protocol/struct.rs In struct.rs: pub struct Struct { members: i8 } impl Struct { pub
I just took the dive into Rust and want to make some basic math functions that are generic. I have the following is_prime function: fn is_prime(n: i64) -> b
I am getting the error: C:\rust\hello_world\src>where link.exe C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\
I want to iterate over over the fields of a struct and access its respective value for each iteration: #[derive(Default, Debug)] struct A { foo: String,
I am building a REST API with actix-web. How do I configure CORS to accept requests from any origin? Cors::new() // <- Construct CORS middleware builder
There are tons of questions about self-referential structs in Rust here, and I think I've read them all, but I'm still having trouble wrapping my head around th
It has been possible to build apps for Arduino and Teensy written in Rust for a while. You can find lists of peripheral libraries ( https://github.com/rust-embe
I found similar question Compile-time generic type size check, but it not received any answer. The problem is in cooperation with other programming language vi
I am trying to write a ray tracer and want to render my image in real time in a GUI window. Basically, I have a buffer: Vec<u8> that is constantly updatin
pub struct FrameBuffer { renderer_id: glow::Framebuffer, color_attachment: glow::Texture, //depth_attachment: glow::Texture, width: u32, hei
egui::Image::new can take a User(u64) as the first parameter. I have a glow::Framebuffer that I want to pass to the function like egui::Image::new(User(frame_bu
Suppose I execute cargo new one --bin and cargo new two --bin then add the same dependency to each project's Cargo.toml and build them. Now there are two absolu
I have an enum: enum Group { OfTwo { first: usize, second: usize, }, OfThree { one: usize, two: usize, three
I have an enum: enum Group { OfTwo { first: usize, second: usize, }, OfThree { one: usize, two: usize, three
I have an enum: enum Group { OfTwo { first: usize, second: usize, }, OfThree { one: usize, two: usize, three
I have an enum: enum Group { OfTwo { first: usize, second: usize, }, OfThree { one: usize, two: usize, three