wrpc_transport::invoke

Trait InvokeExt

Source
pub trait InvokeExt: Invoke {
    // Provided methods
    fn invoke_values<P, Params, Results>(
        &self,
        cx: Self::Context,
        instance: &str,
        func: &str,
        params: Params,
        paths: impl AsRef<[P]> + Send,
    ) -> impl Future<Output = Result<(Results, Option<impl Future<Output = Result<()>> + Send + 'static>)>> + Send
       where P: AsRef<[Option<usize>]> + Send + Sync,
             Params: TupleEncode<Self::Outgoing> + Send,
             Results: TupleDecode<Self::Incoming> + Send,
             <Params::Encoder as Encoder<Params>>::Error: Error + Send + Sync + 'static,
             <Results::Decoder as Decoder>::Error: Error + Send + Sync + 'static { ... }
    fn invoke_values_blocking<P, Params, Results>(
        &self,
        cx: Self::Context,
        instance: &str,
        func: &str,
        params: Params,
        paths: impl AsRef<[P]> + Send,
    ) -> impl Future<Output = Result<Results>> + Send
       where P: AsRef<[Option<usize>]> + Send + Sync,
             Params: TupleEncode<Self::Outgoing> + Send,
             Results: TupleDecode<Self::Incoming> + Send,
             <Params::Encoder as Encoder<Params>>::Error: Error + Send + Sync + 'static,
             <Results::Decoder as Decoder>::Error: Error + Send + Sync + 'static { ... }
    fn timeout(&self, timeout: Duration) -> Timeout<'_, Self> { ... }
    fn timeout_owned(self, timeout: Duration) -> TimeoutOwned<Self>
       where Self: Sized { ... }
}
Expand description

Extension trait for Invoke

Provided Methods§

Source

fn invoke_values<P, Params, Results>( &self, cx: Self::Context, instance: &str, func: &str, params: Params, paths: impl AsRef<[P]> + Send, ) -> impl Future<Output = Result<(Results, Option<impl Future<Output = Result<()>> + Send + 'static>)>> + Send
where P: AsRef<[Option<usize>]> + Send + Sync, Params: TupleEncode<Self::Outgoing> + Send, Results: TupleDecode<Self::Incoming> + Send, <Params::Encoder as Encoder<Params>>::Error: Error + Send + Sync + 'static, <Results::Decoder as Decoder>::Error: Error + Send + Sync + 'static,

Invoke function func on instance instance using typed Params and Results

Source

fn invoke_values_blocking<P, Params, Results>( &self, cx: Self::Context, instance: &str, func: &str, params: Params, paths: impl AsRef<[P]> + Send, ) -> impl Future<Output = Result<Results>> + Send
where P: AsRef<[Option<usize>]> + Send + Sync, Params: TupleEncode<Self::Outgoing> + Send, Results: TupleDecode<Self::Incoming> + Send, <Params::Encoder as Encoder<Params>>::Error: Error + Send + Sync + 'static, <Results::Decoder as Decoder>::Error: Error + Send + Sync + 'static,

Invoke function func on instance instance using typed Params and Results This is like Self::invoke_values, but it only results once all I/O is done

Source

fn timeout(&self, timeout: Duration) -> Timeout<'_, Self>

Returns a Timeout, wrapping Self with an implementation of Invoke, which will error, if call to Invoke::invoke does not return within a supplied timeout

Source

fn timeout_owned(self, timeout: Duration) -> TimeoutOwned<Self>
where Self: Sized,

This is like InvokeExt::timeout, but moves Self and returns corresponding TimeoutOwned

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.

Implementors§

Source§

impl<T: Invoke> InvokeExt for T