Skip to main content

RemoteInvoker

Trait RemoteInvoker 

Source
pub trait RemoteInvoker {
    type Call<R>;
    type View<R>;

    // Required methods
    fn call<R, A>(
        &self,
        target: &ContractAddress,
        method: RemoteMethod,
        args: &A,
    ) -> Self::Call<R>
       where R: ReadXDROwned,
             A: WriteXDR + ?Sized;
    fn view<R, A>(
        &self,
        target: &ContractAddress,
        method: RemoteMethod,
        args: &A,
    ) -> Self::View<R>
       where R: ReadXDROwned,
             A: WriteXDR + ?Sized;
}
Expand description

Prepares invocations of deployed contracts for a remote proxy.

The proxy routes pure and readOnly methods to view and every other method, including those without a declared effect, to call. args holds the method’s arguments: the single argument itself, or a tuple of several. Implementations encode it before returning, since the prepared invocation cannot borrow it.

Required Associated Types§

Source

type Call<R>

A prepared invocation of a method that may change state.

Source

type View<R>

A prepared read of a pure or readOnly method.

Required Methods§

Source

fn call<R, A>( &self, target: &ContractAddress, method: RemoteMethod, args: &A, ) -> Self::Call<R>
where R: ReadXDROwned, A: WriteXDR + ?Sized,

Prepare an invocation of method on target.

Source

fn view<R, A>( &self, target: &ContractAddress, method: RemoteMethod, args: &A, ) -> Self::View<R>
where R: ReadXDROwned, A: WriteXDR + ?Sized,

Prepare a read of method on target.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§