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§
Sourcefn available(&self) -> bool
fn available(&self) -> bool
Go HeartbeatOK: requests are refused while the control plane is unreachable.
Sourcefn dispatch(
&self,
request: RemoteRequest,
) -> BoxFuture<'_, Result<RemoteGrant, RemoteError>>
fn dispatch( &self, request: RemoteRequest, ) -> BoxFuture<'_, Result<RemoteGrant, RemoteError>>
One pick.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".