pub trait Controller: Send + Sync {
// Required methods
fn controller_type(&self) -> &str;
fn agent_id(&self) -> &str;
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_running(&self) -> bool;
fn cortical_ids(&self) -> &[CorticalID];
}Expand description
Core controller trait
Implement this trait to create custom controllers that follow FEAGI conventions.
§Example
ⓘ
use feagi_agent::sdk::base::Controller;
struct MyController {
// ... fields
}
#[async_trait::async_trait]
impl Controller for MyController {
fn controller_type(&self) -> &str { "my-custom" }
fn agent_id(&self) -> &str { &self.agent_id }
async fn start(&mut self) -> Result<()> { /* ... */ }
async fn stop(&mut self) -> Result<()> { /* ... */ }
fn is_running(&self) -> bool { /* ... */ }
fn cortical_ids(&self) -> &[CorticalID] { /* ... */ }
}Required Methods§
Sourcefn controller_type(&self) -> &str
fn controller_type(&self) -> &str
Controller type identifier (e.g., “video”, “text”, “audio”)
Sourcefn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the controller (connect to FEAGI, begin operation)
Sourcefn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the controller gracefully
Sourcefn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if controller is currently running
Sourcefn cortical_ids(&self) -> &[CorticalID]
fn cortical_ids(&self) -> &[CorticalID]
Get cortical IDs this controller produces/consumes