It wouldn't be self.something because it doesn't take a self argument. Try Pool::produce_obj::<T>(...) ? Or add a self argument to it and then call it normally.
On Sat, Nov 9, 2013 at 1:31 AM, wuyunlong <[email protected]> wrote: > struct Pool<T>{ > produce_obj : ~fn()->T, > elements : ~[T] > } > > impl<T:Send> Pool<T>{ > > fn new_obj(&mut self){ > let obj = self. ... ;*// Here ,how to execute method > "produce_obj" ?* > self.elements.push(obj); > } > } > > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
