MCPcopy Create free account
hub / github.com/EXboys/skilllite / ProtocolHandler

Interface ProtocolHandler

skilllite/src/protocol.rs:74–81  ·  view source on GitHub ↗

Extension point for Entry Layer protocols. Every transport that exposes SkillLite functionality externally implements this trait. The CLI dispatches `Commands` variants to the matching handler. `serve` is synchronous and blocks until the server shuts down. Async handlers (e.g. a future P2P listener) should create a `tokio::Runtime` internally rather than making the trait `async`, keeping the c

Source from the content-addressed store, hash-verified

72/// internally rather than making the trait `async`, keeping the call site
73/// simple and avoiding `async-trait` overhead.
74pub trait ProtocolHandler: Send + Sync {
75 /// Protocol name used in log output and diagnostics.
76 #[allow(dead_code)]
77 fn name(&self) -> &str;
78
79 /// Start the protocol server. Blocks until shutdown.
80 fn serve(&self, params: ProtocolParams) -> Result<()>;
81}
82
83// ─── Handler Implementations ─────────────────────────────────────────────────
84

Callers

nothing calls this directly

Implementers 1

protocol.rsskilllite/src/protocol.rs

Calls

no outgoing calls

Tested by

no test coverage detected