Trait cog_rust::Cog

source ·
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, Global>>
       where Self: 'async_trait;
    fn predict(&self, input: Self::Request) -> Result<Self::Response, Error>;
}

Required Associated Types§

Required Methods§

source

fn setup<'async_trait>( ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait, Global>>where Self: 'async_trait,

Setup the cog

Errors

Returns an error if setup fails.

source

fn predict(&self, input: Self::Request) -> Result<Self::Response, Error>

Run a prediction

Implementors§