This topic created in 2172 days ago, the information mentioned may be changed or developed.
函数指针 Vec 是可以实现的,但是不知道如何实现闭包 Vec 。
type Bibao = dyn Fn(String)->String + 'static;
pub fn close_test4(){ let a = "456"; let b1: Bibao = move |mut s:String|{ s.push_str(a); s }; let mut v = Vec::new(); op1(b1,&v); v.get(0)(String::from("123")); }