Trait cog_rust::Cog

source ·
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;
}

Required Associated Types§

Required Methods§

source

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

Setup the cog

Errors

Returns an error if setup fails.

source

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,

Run a prediction

Implementors§