peace_rt_model 0.0.15

Runtime data types for the peace automation framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::outcomes::{ItemApplyPartial, ItemApplyPartialRt};

/// A boxed `ItemApplyPartial`.
#[derive(Clone, serde::Serialize)]
pub struct ItemApplyPartialBoxed(pub(crate) Box<dyn ItemApplyPartialRt>);

impl<State, StateDiff> From<ItemApplyPartial<State, StateDiff>> for ItemApplyPartialBoxed
where
    ItemApplyPartial<State, StateDiff>: ItemApplyPartialRt,
{
    /// Returns an `ItemApplyPartialBoxed` which erases an
    /// `ItemApplyPartial`'s type parameters.
    fn from(item_apply: ItemApplyPartial<State, StateDiff>) -> Self {
        Self(Box::new(item_apply))
    }
}

crate::outcomes::box_data_type_newtype!(ItemApplyPartialBoxed, ItemApplyPartialRt);