hyperstack_server/
mutation_batch.rs1use hyperstack_interpreter::Mutation;
4use smallvec::SmallVec;
5use tracing::Span;
6
7#[derive(Debug)]
12pub struct MutationBatch {
13 pub span: Span,
15 pub mutations: SmallVec<[Mutation; 6]>,
17}
18
19impl MutationBatch {
20 pub fn new(mutations: SmallVec<[Mutation; 6]>) -> Self {
21 Self {
22 span: Span::current(),
23 mutations,
24 }
25 }
26
27 pub fn with_span(span: Span, mutations: SmallVec<[Mutation; 6]>) -> Self {
28 Self { span, mutations }
29 }
30
31 pub fn len(&self) -> usize {
32 self.mutations.len()
33 }
34
35 pub fn is_empty(&self) -> bool {
36 self.mutations.is_empty()
37 }
38}