Can you clone a closure?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: A FnMut closure cannot be cloned, for obvious reasons, but a Fn closure has an immutable scope; is there some way to create a "duplicate" of a Fn closure? Trying to clone it results in: error [ E0599 ]: no method named `clone` found for type `std::boxed::Box<std::ops::Fn(i8, i8) -> i8 + std::marker::Send + 'static>` in the current scope --> src / main . rs : 22 : 25 | 22 | fp : self . fp . clone (), | ^^^^^ | = note : self . fp is a function , perhaps you wish to call it = note : the method `clone` exists but the following trait