pub struct Canister(/* private fields */);Implementations§
Source§impl Canister
impl Canister
pub async fn create( settings: Option<CanisterSettings>, cycles: u64, ) -> Result<Self, (RejectionCode, String)>
Sourcepub fn accept_cycles() -> u64
pub fn accept_cycles() -> u64
A helper method to accept cycles from caller.
pub async fn provisional_create_with_cycles( amount: u64, settings: Option<CanisterSettings>, ) -> Result<Self, (RejectionCode, String)>
pub async fn update_settings( &self, settings: CanisterSettings, ) -> Result<(), (RejectionCode, String)>
pub async fn install_code<T: ArgumentEncoder>( &self, mode: InstallCodeMode, wasm_module: WasmModule, arg: T, ) -> Result<(), (RejectionCode, String)>
pub async fn uninstall_code(&self) -> Result<(), (RejectionCode, String)>
pub async fn start(&self) -> Result<(), (RejectionCode, String)>
pub async fn stop(&self) -> Result<(), (RejectionCode, String)>
pub async fn status(&self) -> Result<CanisterStatus, (RejectionCode, String)>
pub async fn delete(&self) -> Result<(), (RejectionCode, String)>
pub async fn deposit_cycles(&self) -> Result<(), (RejectionCode, String)>
pub async fn raw_rand(&self) -> Result<Vec<u8>, (RejectionCode, String)>
pub async fn provisional_top_up( &self, amount: u128, ) -> Result<(), (RejectionCode, String)>
Trait Implementations§
Source§impl AsRef<Principal> for Canister
impl AsRef<Principal> for Canister
Source§fn as_ref(&self) -> &CanisterID
fn as_ref(&self) -> &CanisterID
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl CandidType for Canister
impl CandidType for Canister
Source§impl<'de> Deserialize<'de> for Canister
impl<'de> Deserialize<'de> for Canister
Source§fn 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
Source§impl From<Canister> for CanisterID
impl From<Canister> for CanisterID
Source§impl From<Principal> for Canister
impl From<Principal> for Canister
Source§fn from(id: CanisterID) -> Self
fn from(id: CanisterID) -> Self
Converts to this type from the input type.
Source§impl Ord for Canister
impl Ord for Canister
Source§impl PartialOrd for Canister
impl PartialOrd for Canister
impl Copy for Canister
impl Eq for Canister
impl StructuralPartialEq for Canister
Auto Trait Implementations§
impl Freeze for Canister
impl RefUnwindSafe for Canister
impl Send for Canister
impl Sync for Canister
impl Unpin for Canister
impl UnwindSafe for Canister
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