SyncCall

Trait SyncCall 

Source
pub trait SyncCall: CallIntoFuture<Output = Result<Self::Value, AgentError>> {
    type Value: for<'de> ArgumentDecoder<'de> + Send;

    // Required methods
    fn call_raw<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + 'async_trait>>
       where Self: 'async_trait;
    fn call<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Value, AgentError>> + 'async_trait>>
       where Self: Sized + Send + 'async_trait,
             Self::Value: 'async_trait;
}
Expand description

A type that implements synchronous calls (ie. ‘query’ calls).

Required Associated Types§

Source

type Value: for<'de> ArgumentDecoder<'de> + Send

The return type of the Candid function being called.

Required Methods§

Source

fn call_raw<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, AgentError>> + 'async_trait>>
where Self: 'async_trait,

Available on crate feature raw only.

Execute the call, return an array of bytes directly from the canister.

Source

fn call<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<Self::Value, AgentError>> + 'async_trait>>
where Self: Sized + Send + 'async_trait, Self::Value: 'async_trait,

Execute the call, returning either the value returned by the canister, or an error returned by the Agent.

Implementors§

Source§

impl<'agent, Out> SyncCall for SyncCaller<'agent, Out>
where Self: Sized, Out: 'agent + for<'de> ArgumentDecoder<'de> + Send,

Source§

type Value = Out