junobuild_utils/serializers/types.rs
1use candid::Principal as CandidPrincipal;
2
3/// Represents a wrapper around the `candid::Principal` type.
4///
5/// This struct is designed to encapsulate a Candid Principal, allowing for
6/// integration and usage within Juno hooks contexts.
7///
8/// # Fields
9/// - `value`: The `Principal` this struct wraps.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
11pub struct DocDataPrincipal {
12 pub value: CandidPrincipal,
13}
14
15/// Represents a large integer value for document data, particularly useful for interacting with
16/// languages or environments that support large numeric types, such as the `bigint` in JavaScript.
17///
18/// # Fields
19/// - `value`: A `u64` integer representing the large numeric value encapsulated by this struct.
20#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
21pub struct DocDataBigInt {
22 pub value: u64,
23}