Skip to main content

canic_core/ids/
intent.rs

1//! Module: ids::intent
2//!
3//! Responsibility: intent identifiers and resource keys.
4//! Does not own: intent execution, replay policy, or resource authorization.
5//! Boundary: exposes compact IDs used across workflow and ops boundaries.
6
7use crate::cdk::types::BoundedString128;
8use serde::{Deserialize, Serialize};
9use std::fmt::{self, Display};
10
11///
12/// IntentId
13///
14/// Numeric identifier for one recorded or replayable intent.
15///
16
17#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
18pub struct IntentId(pub u64);
19
20impl Display for IntentId {
21    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22        write!(f, "{}", self.0)
23    }
24}
25
26///
27/// IntentResourceKey
28///
29/// Bounded resource key associated with an intent.
30///
31
32pub type IntentResourceKey = BoundedString128;