Skip to main content

canic_dsl/access/
caller.rs

1#[derive(Clone, Copy, Debug)]
2pub struct IsController;
3
4#[derive(Clone, Copy, Debug)]
5pub struct IsParent;
6
7#[derive(Clone, Copy, Debug)]
8pub struct IsChild;
9
10#[derive(Clone, Copy, Debug)]
11pub struct IsRoot;
12
13#[derive(Clone, Copy, Debug)]
14pub struct IsSameCanister;
15
16#[derive(Clone, Copy, Debug)]
17pub struct IsRegisteredToSubnet;
18
19#[derive(Clone, Copy, Debug)]
20pub struct IsWhitelisted;
21
22#[must_use]
23pub const fn is_controller() -> IsController {
24    IsController
25}
26
27#[must_use]
28pub const fn is_parent() -> IsParent {
29    IsParent
30}
31
32#[must_use]
33pub const fn is_child() -> IsChild {
34    IsChild
35}
36
37#[must_use]
38pub const fn is_root() -> IsRoot {
39    IsRoot
40}
41
42#[must_use]
43pub const fn is_same_canister() -> IsSameCanister {
44    IsSameCanister
45}
46
47#[must_use]
48pub const fn is_registered_to_subnet() -> IsRegisteredToSubnet {
49    IsRegisteredToSubnet
50}
51
52#[must_use]
53pub const fn is_whitelisted() -> IsWhitelisted {
54    IsWhitelisted
55}