pub trait DaemonDispatch:
Clone
+ Send
+ Sync
+ 'static {
// Required methods
fn dispatch<'life0, 'async_trait>(
&'life0 self,
ops: String,
presentation: Option<String>,
presentation_per_op: Option<Vec<Option<String>>>,
format: Option<String>,
format_per_op: Option<Vec<Option<String>>>,
from_wire: bool,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn warm_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn namespace(&self) -> &str;
fn config_id(&self) -> &str;
// Provided method
fn pool_for_checkpoint(&self) -> Option<Arc<ConnectionPool>> { ... }
}Expand description
Transport-agnostic dispatch interface for the daemon server.
The MCP crate implements this by dispatching through the shared request body
while honoring DaemonRequestFrame::from_wire (so subhandler visibility is
gated by request origin, not by transport); any future transport can do the
same.
Required Methods§
Sourcefn dispatch<'life0, 'async_trait>(
&'life0 self,
ops: String,
presentation: Option<String>,
presentation_per_op: Option<Vec<Option<String>>>,
format: Option<String>,
format_per_op: Option<Vec<Option<String>>>,
from_wire: bool,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dispatch<'life0, 'async_trait>(
&'life0 self,
ops: String,
presentation: Option<String>,
presentation_per_op: Option<Vec<Option<String>>>,
format: Option<String>,
format_per_op: Option<Vec<Option<String>>>,
from_wire: bool,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dispatch a verb-DSL request string and return the rendered result.
from_wire carries the origin discriminator from
DaemonRequestFrame::from_wire: when true, the implementor enforces
verb visibility (rejects Visibility::Subhandler verbs); when false,
the request is from a trusted operator surface and subhandlers pass.
Provided Methods§
Sourcefn pool_for_checkpoint(&self) -> Option<Arc<ConnectionPool>>
fn pool_for_checkpoint(&self) -> Option<Arc<ConnectionPool>>
Return the pool to use for background WAL checkpointing, if available.
Implementors backed by a file-based SQLite database should return
Some(pool_arc). In-memory or test dispatchers that have no pool
return None and the checkpoint task is not spawned.
The default implementation returns None.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".