kcl_api/front.rs
1use serde::Deserialize;
2use serde::Serialize;
3
4#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, PartialOrd, Ord, Deserialize, Serialize, ts_rs::TS)]
5#[ts(export, export_to = "FrontendApi.ts", rename = "ApiObjectId")]
6pub struct ObjectId(pub usize);
7
8impl ObjectId {
9 pub fn predecessor(self) -> Option<Self> {
10 self.0.checked_sub(1).map(ObjectId)
11 }
12}