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§
Required Associated Types§
type Arguments: ArgumentEncoder
type Response: for<'de> ArgumentDecoder<'de>
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>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.