Skip to main content

Method

Trait Method 

Source
pub trait Method {
    type Request: Wire;
    type Response: Wire;

    const ID: u64;
    const NAME: &'static str;
    const REQUEST_LIMITS: Limits;
    const RESPONSE_LIMITS: Limits;
}
Expand description

One consumer-owned endpoint contract. IDs must be unique across incompatible layouts and methods. A source rename alone must not change its identity.

Required Associated Constants§

Source

const ID: u64

Stable contract identity assigned by the consumer.

Source

const NAME: &'static str

Exact exported IC method name; used by typed transport adapters.

Source

const REQUEST_LIMITS: Limits

Request admission budget.

Source

const RESPONSE_LIMITS: Limits

Reply admission budget.

Required Associated Types§

Source

type Request: Wire

Typed request, including any consumer-owned proof/envelope.

Source

type Response: Wire

Typed response, typically Result<Success, ApplicationError>.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§