pub struct EnvOps;Expand description
EnvOps
NOTE:
try_*getters are test-only helpers for incomplete env setup.- Non-
try_*getters assume the environment has been fully initialized during canister startup and will panic if called earlier. - After initialization, absence of environment fields is a programmer error.
Implementations§
Source§impl EnvOps
impl EnvOps
pub fn import(env: EnvData) -> Result<(), Error>
pub fn set_prime_root_pid(pid: Principal)
pub fn set_subnet_role(role: SubnetRole)
pub fn set_subnet_pid(pid: Principal)
pub fn set_root_pid(pid: Principal)
pub fn set_canister_role(role: CanisterRole)
pub fn is_prime_root() -> bool
pub fn is_prime_subnet() -> bool
pub fn is_root() -> bool
pub fn subnet_role() -> SubnetRole
pub fn canister_role() -> CanisterRole
pub fn subnet_pid() -> Principal
pub fn root_pid() -> Principal
pub fn prime_root_pid() -> Principal
pub fn parent_pid() -> Principal
Auto Trait Implementations§
impl Freeze for EnvOps
impl RefUnwindSafe for EnvOps
impl Send for EnvOps
impl Sync for EnvOps
impl Unpin for EnvOps
impl UnwindSafe for EnvOps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more