Skip to main content

openusd_rs/sdf/
list_op.rs

1use crate::{sdf, tf};
2
3/// Enum for specifying one of the list editing operation types.
4pub enum ListOpType {
5	Explicit,
6	Added,
7	Deleted,
8	Ordered,
9	Prepended,
10	Appended,
11}
12
13/// Value type representing a list-edit operation.
14#[derive(Debug, Default, Clone)]
15pub struct ListOp<T> {
16	pub is_explicit: bool,
17	pub explicit_items: Vec<T>,
18	pub added_items: Vec<T>,
19	pub prepended_items: Vec<T>,
20	pub appended_items: Vec<T>,
21	pub deleted_items: Vec<T>,
22	pub ordered_items: Vec<T>,
23}
24
25pub type IntListOp = ListOp<i32>;
26pub type UIntListOp = ListOp<u32>;
27pub type Int64ListOp = ListOp<i64>;
28pub type UInt64ListOp = ListOp<u64>;
29
30pub type TokenListOp = ListOp<tf::Token>;
31pub type StringListOp = ListOp<String>;
32pub type PathListOp = ListOp<sdf::Path>;
33pub type ReferenceListOp = ListOp<sdf::Reference>;
34pub type PayloadListOp = ListOp<sdf::Payload>;