use crate::agent::DynLocalAgent;
use crate::{BoxFut, K2Result, builder, config, id};
use std::sync::Arc;
pub trait LocalAgentStore: 'static + Send + Sync + std::fmt::Debug {
fn add(&self, local_agent: DynLocalAgent) -> BoxFut<'_, K2Result<()>>;
fn remove(
&self,
local_agent: id::AgentId,
) -> BoxFut<'_, Option<DynLocalAgent>>;
fn get_all(&self) -> BoxFut<'_, K2Result<Vec<DynLocalAgent>>>;
}
pub type DynLocalAgentStore = Arc<dyn LocalAgentStore>;
pub trait LocalAgentStoreFactory:
'static + Send + Sync + std::fmt::Debug
{
fn default_config(&self, config: &mut config::Config) -> K2Result<()>;
fn validate_config(&self, config: &config::Config) -> K2Result<()>;
fn create(
&self,
builder: Arc<builder::Builder>,
) -> BoxFut<'static, K2Result<DynLocalAgentStore>>;
}
pub type DynLocalAgentStoreFactory = Arc<dyn LocalAgentStoreFactory>;