Hi. Im learning rust and now I have a list of little questions that I would like to ask.
I know that its preferred to ask different questions on different topic but thats a lot of work
1- What is &* that some times apeear before strings. why just not use & ?
2- imagine we have an int number named var. what difference between these raw pointers
let a = &var as *const i32;
let b = var as *const i32;
I’m having some guesses but I’m not sure
3- why should we use [#no_mangle] before this syntax
extern "C" fn call_from_c()
4-this was mentioned in tutorial. but it didn’t include an example. when dynamic dispatch becomes more efficient than static dispatch?
5- is there any way to require a generic NOT to implement some trait?
6- is there any way to use “or” operator on trait bounds? for example generic T should implement either trait sized or send.
7- is there a better way to make threads join main thread? currently I’m assigning spawns result to a variable and then use join function on that variable.