moduforge_model/mark.rs
1use serde::{Deserialize, Serialize};
2
3use super::attrs::Attrs;
4/**
5 * 基础标记实现 例如颜色 背景色 批注
6 * @property type 标记类型
7 * @property attrs 标记属性
8 * @author string<348040933@qq.com>
9 */
10#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
11pub struct Mark {
12 pub r#type: String,
13 pub attrs: Attrs,
14}
15
16impl Mark {
17 pub fn set_from(marks: Option<Vec<Mark>>) -> Vec<Mark> {
18 marks.unwrap_or_default()
19 }
20}