Skip to main content

vvv_engine/protocol/intent/
batch.rs

1use serde::{Deserialize, Serialize};
2
3use super::Intent;
4
5/// Several intents planned in sequence, each against the state the previous
6/// one leaves, and applied as one.
7#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8pub struct BatchIntent {
9    pub intents: Vec<Intent>,
10}
11
12impl BatchIntent {
13    pub fn new(intents: impl IntoIterator<Item = Intent>) -> Self {
14        Self {
15            intents: intents.into_iter().collect(),
16        }
17    }
18}