Skip to main content

canic_dsl/access/
caller.rs

1///
2/// IsController
3///
4
5#[derive(Clone, Copy, Debug)]
6pub struct IsController;
7
8///
9/// IsParent
10///
11
12#[derive(Clone, Copy, Debug)]
13pub struct IsParent;
14
15///
16/// IsChild
17///
18
19#[derive(Clone, Copy, Debug)]
20pub struct IsChild;
21
22///
23/// IsRoot
24///
25
26#[derive(Clone, Copy, Debug)]
27pub struct IsRoot;
28
29///
30/// IsSameCanister
31///
32
33#[derive(Clone, Copy, Debug)]
34pub struct IsSameCanister;
35
36///
37/// IsRegisteredToSubnet
38///
39
40#[derive(Clone, Copy, Debug)]
41pub struct IsRegisteredToSubnet;
42
43///
44/// IsWhitelisted
45///
46
47#[derive(Clone, Copy, Debug)]
48pub struct IsWhitelisted;
49
50#[must_use]
51pub const fn is_controller() -> IsController {
52    IsController
53}
54
55#[must_use]
56pub const fn is_parent() -> IsParent {
57    IsParent
58}
59
60#[must_use]
61pub const fn is_child() -> IsChild {
62    IsChild
63}
64
65#[must_use]
66pub const fn is_root() -> IsRoot {
67    IsRoot
68}
69
70#[must_use]
71pub const fn is_same_canister() -> IsSameCanister {
72    IsSameCanister
73}
74
75#[must_use]
76pub const fn is_registered_to_subnet() -> IsRegisteredToSubnet {
77    IsRegisteredToSubnet
78}
79
80#[must_use]
81pub const fn is_whitelisted() -> IsWhitelisted {
82    IsWhitelisted
83}