I am trying to understand what scope is for functions defined in the impl block, but which do not accept &self as a parameter. For example, why is the following code fragment not compiling? I get the error "I can not find the generate_a_result function in this area."
pub struct Blob { num: u32, } impl Blob { pub fn new() -> Blob { generate_a_result() } fn generate_a_result() -> Blob { let result = Blob { num: 0 }; result } }
source share