pub trait Backend: Send + Sync {
type Config: Send + Sync + 'static;
type Session: Session + 'static;
// Required methods
fn name(&self) -> &'static str;
fn capabilities(&self) -> BackendCapabilities;
fn session(
&self,
config: SessionConfig<Self::Config>,
) -> impl Future<Output = Result<Self::Session, AgentError>> + Send;
fn resume(
&self,
session_id: &str,
config: SessionConfig<Self::Config>,
) -> impl Future<Output = Result<Self::Session, AgentError>> + Send;
}Expand description
Factory for creating agent sessions.
Not object-safe (has associated types and RPITIT). Use AgentBackend
from the facade crate for runtime dispatch.
Required Associated Types§
Required Methods§
Sourcefn capabilities(&self) -> BackendCapabilities
fn capabilities(&self) -> BackendCapabilities
Backend feature support exposed by this implementation.
This reports backend-level support. For config-dependent behavior,
callers should consult the backend config’s own capabilities()
helper when available.
Sourcefn session(
&self,
config: SessionConfig<Self::Config>,
) -> impl Future<Output = Result<Self::Session, AgentError>> + Send
fn session( &self, config: SessionConfig<Self::Config>, ) -> impl Future<Output = Result<Self::Session, AgentError>> + Send
Start a new agent session.
Sourcefn resume(
&self,
session_id: &str,
config: SessionConfig<Self::Config>,
) -> impl Future<Output = Result<Self::Session, AgentError>> + Send
fn resume( &self, session_id: &str, config: SessionConfig<Self::Config>, ) -> impl Future<Output = Result<Self::Session, AgentError>> + Send
Resume a previously saved session by ID.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".