pub struct CapEnv { /* private fields */ }Expand description
Contains data about the cap environment.
Implementations
sourceimpl CapEnv
impl CapEnv
sourcepub fn load_from_archive(env: CapEnv)
👎 Deprecated: Use the safer cap_sdk::from_archive
pub fn load_from_archive(env: CapEnv)
Use the safer cap_sdk::from_archive
Sets the CapEnv using the provided value.
Used to restore the generated canister’s ID after an upgrade.
sourcepub fn to_archive() -> Self
👎 Deprecated: Use the safer cap_sdk::archive
pub fn to_archive() -> Self
Use the safer cap_sdk::archive
Gets the CapEnv.
Should be used during the upgrade process of a contract canister.
Call it during pre_upgrade to write it somewhere in stable storage.
Afterwards, write it back with CapEnv::load_from_archive
Trait Implementations
sourceimpl<'de> Deserialize<'de> for CapEnv
impl<'de> Deserialize<'de> for CapEnv
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for CapEnv
impl Send for CapEnv
impl Sync for CapEnv
impl Unpin for CapEnv
impl UnwindSafe for CapEnv
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more