bastion
bastion copied to clipboard
Process stack needs to store data
We want to carry actual data with process stack but we can't because of size bounds are varying. We need to find a way to do this to make simpler callback implementation.
pub struct ProcStack<S> {
pub state: S,
pub before_start: Option<Arc<dyn Fn(&mut S) + Send + Sync>>,
// ...
}
@azastrael mentioned to not move whole environment to Fn. Creates unnecessary copies.