pub trait Cog: Sized + Send {
type Request: DeserializeOwned + JsonSchema;
type Response: CogResponse + Debug + JsonSchema;
// Required methods
fn setup<'async_trait>(
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait;
fn predict<'life0, 'async_trait>(
&'life0 self,
input: Self::Request
) -> Pin<Box<dyn Future<Output = Result<Self::Response>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Setup the cog
Returns an error if setup fails.