pub trait Cog: Sized + Send {
type Request: DeserializeOwned + JsonSchema + Send;
type Response: CogResponse + Debug + JsonSchema;
// Required methods
fn setup<'async_trait>( ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: 'async_trait;
fn predict(&self, input: Self::Request) -> Result<Self::Response, Error>;
}
Required Associated Types§
type Request: DeserializeOwned + JsonSchema + Send
type Response: CogResponse + Debug + JsonSchema
Required Methods§
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.