Skip to main content

RemoteDispatch

Trait RemoteDispatch 

Source
pub trait RemoteDispatch:
    Send
    + Sync
    + 'static {
    // Required methods
    fn available(&self) -> bool;
    fn dispatch(
        &self,
        request: RemoteRequest,
    ) -> BoxFuture<'_, Result<RemoteGrant, RemoteError>>;
    fn models(
        &self,
        headers: Vec<(String, String)>,
        query: Vec<(String, String)>,
    ) -> BoxFuture<'_, Result<Vec<u8>, ModelsError>>;

    // Provided method
    fn request_log(&self, payload: Vec<u8>) -> BoxFuture<'_, Result<(), String>> { ... }
}

Required Methods§

Source

fn available(&self) -> bool

Go HeartbeatOK: requests are refused while the control plane is unreachable.

Source

fn dispatch( &self, request: RemoteRequest, ) -> BoxFuture<'_, Result<RemoteGrant, RemoteError>>

One pick.

Source

fn models( &self, headers: Vec<(String, String)>, query: Vec<(String, String)>, ) -> BoxFuture<'_, Result<Vec<u8>, ModelsError>>

Go GetModels: the catalog for the client these request headers and query parameters authenticate (raw Home payload).

Provided Methods§

Source

fn request_log(&self, payload: Vec<u8>) -> BoxFuture<'_, Result<(), String>>

Go RPushRequestLog. Unavailable Home lifetimes discard the log, never fall back to writing it locally. Test/internal dispatchers may ignore it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§