Skip to main content

Method

Trait Method 

Source
pub trait Method {
    type Arguments: ArgumentEncoder;
    type Response: for<'de> ArgumentDecoder<'de>;

    const NAME: &'static str;

    // Provided methods
    fn perform(
        id: Principal,
        args: Self::Arguments,
    ) -> CallResponse<Self::Response> { ... }
    fn perform_with_payment(
        id: Principal,
        args: Self::Arguments,
        cycles: u64,
    ) -> CallResponse<Self::Response> { ... }
}
Expand description

A method description.

Required Associated Constants§

Source

const NAME: &'static str

Required Associated Types§

Provided Methods§

Source

fn perform(id: Principal, args: Self::Arguments) -> CallResponse<Self::Response>

Source

fn perform_with_payment( id: Principal, args: Self::Arguments, cycles: u64, ) -> CallResponse<Self::Response>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Method for CanisterStatus

Source§

const NAME: &'static str = "canister_status"

Source§

type Arguments = (WithCanisterId,)

Source§

type Response = (CanisterStatusResponse,)

Source§

impl Method for CreateCanister

Source§

const NAME: &'static str = "create_canister"

Source§

type Arguments = (CreateCanisterArgument,)

Source§

type Response = (WithCanisterId,)

Source§

impl Method for DeleteCanister

Source§

const NAME: &'static str = "delete_canister"

Source§

type Arguments = (WithCanisterId,)

Source§

type Response = ()

Source§

impl Method for DepositCycles

Source§

const NAME: &'static str = "deposit_cycles"

Source§

type Arguments = (WithCanisterId,)

Source§

type Response = ()

Source§

impl Method for InstallCode

Source§

const NAME: &'static str = "install_code"

Source§

type Arguments = (InstallCodeArgument,)

Source§

type Response = ()

Source§

impl Method for ProvisionalCreateCanisterWithCycles

Source§

const NAME: &'static str = "provisional_create_canister_with_cycles"

Source§

type Arguments = (ProvisionalCreateCanisterWithCyclesArgument,)

Source§

type Response = (WithCanisterId,)

Source§

impl Method for ProvisionalTopUpCanister

Source§

const NAME: &'static str = "provisional_top_up_canister"

Source§

type Arguments = (ProvisionalTopUpCanisterArgument,)

Source§

type Response = ()

Source§

impl Method for RawRand

Source§

const NAME: &'static str = "raw_rand"

Source§

type Arguments = ()

Source§

type Response = (Vec<u8>,)

Source§

impl Method for StartCanister

Source§

const NAME: &'static str = "start_canister"

Source§

type Arguments = (WithCanisterId,)

Source§

type Response = ()

Source§

impl Method for StopCanister

Source§

const NAME: &'static str = "stop_canister"

Source§

type Arguments = (WithCanisterId,)

Source§

type Response = ()

Source§

impl Method for UninstallCode

Source§

const NAME: &'static str = "uninstall_code"

Source§

type Arguments = (WithCanisterId,)

Source§

type Response = ()

Source§

impl Method for UpdateSettings

Source§

const NAME: &'static str = "update_settings"

Source§

type Arguments = (UpdateSettingsArgument,)

Source§

type Response = ()