When implementing the default trait for a struct, and intializing its members using functions, are those functions evaluated once or several times?

后端 未结 0 1044
旧巷少年郎
旧巷少年郎 2020-12-13 06:06

I m having the following pseudocode inside a crate

pub static struct connection {
  pub Id: i32,
  pub speed: i32,
}

impl connection {
  pub fn new() -> S         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题