Skip to main content

Invoke

Trait Invoke 

Source
pub trait Invoke: Send + Sync {
    type Context: Send + Sync;

    // Required method
    fn invoke<P>(
        &self,
        cx: Self::Context,
        instance: &str,
        func: &str,
        params: Bytes,
        paths: impl AsRef<[P]> + Send,
    ) -> impl Future<Output = Result<(Outgoing, Incoming)>> + Send
       where P: AsRef<[Option<usize>]> + Send + Sync;
}
Expand description

Client-side handle to a wRPC transport

Invocations are always multiplexed over the wRPC framing layer, so the outgoing and incoming byte streams are the framed Outgoing and Incoming streams regardless of the underlying transport.

Required Associated Types§

Source

type Context: Send + Sync

Transport-specific invocation context

Required Methods§

Source

fn invoke<P>( &self, cx: Self::Context, instance: &str, func: &str, params: Bytes, paths: impl AsRef<[P]> + Send, ) -> impl Future<Output = Result<(Outgoing, Incoming)>> + Send
where P: AsRef<[Option<usize>]> + Send + Sync,

Invoke function func on instance instance

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Invoke for wrpc_transport::frame::unix::Client<&Path>

Source§

impl Invoke for wrpc_transport::frame::unix::Client<&SocketAddr>

Source§

impl Invoke for wrpc_transport::frame::unix::Client<PathBuf>

Source§

impl Invoke for wrpc_transport::frame::unix::Client<SocketAddr>

Source§

impl<I, O> Invoke for &Oneshot<I, O>
where I: AsyncRead + Send + Unpin + 'static, O: AsyncWrite + Send + Unpin + 'static,

Source§

impl<I, O> Invoke for Oneshot<I, O>
where I: AsyncRead + Send + Unpin + 'static, O: AsyncWrite + Send + Unpin + 'static,

Source§

impl<T: Invoke> Invoke for Timeout<'_, T>

Source§

impl<T: Invoke> Invoke for TimeoutOwned<T>

Source§

impl<T> Invoke for wrpc_transport::frame::tcp::tokio::Client<T>
where T: ToSocketAddrs + Clone + Send + Sync,