Fix compile errors
This commit is contained in:
parent
67a48cd6f8
commit
06514ed935
3 changed files with 9 additions and 3 deletions
|
@ -14,7 +14,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use mcp_server::router::RouterService;
|
use mcp_server::router::RouterService;
|
||||||
use rust_doc_server::{jsonrpc_frame_codec::JsonRpcFrameCodec, DocRouter};
|
use cratedocs_mcp::{jsonrpc_frame_codec::JsonRpcFrameCodec, DocRouter};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::{
|
use tokio::{
|
||||||
io::{self, AsyncWriteExt},
|
io::{self, AsyncWriteExt},
|
||||||
|
@ -131,7 +131,7 @@ async fn sse_handler(State(app): State<App>) -> Sse<impl Stream<Item = Result<Ev
|
||||||
.chain(
|
.chain(
|
||||||
FramedRead::new(s2c_read, JsonRpcFrameCodec)
|
FramedRead::new(s2c_read, JsonRpcFrameCodec)
|
||||||
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
|
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
|
||||||
.and_then(move |bytes| match std::str::from_utf8(&bytes) {
|
.and_then(move |bytes| match std::str::from_utf8(bytes.as_ref()) {
|
||||||
Ok(message) => futures::future::ok(Event::default().event("message").data(message)),
|
Ok(message) => futures::future::ok(Event::default().event("message").data(message)),
|
||||||
Err(e) => futures::future::err(io::Error::new(io::ErrorKind::InvalidData, e)),
|
Err(e) => futures::future::err(io::Error::new(io::ErrorKind::InvalidData, e)),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use mcp_server::router::RouterService;
|
use mcp_server::router::RouterService;
|
||||||
use mcp_server::{ByteTransport, Server};
|
use mcp_server::{ByteTransport, Server};
|
||||||
use rust_doc_server::DocRouter;
|
use cratedocs_mcp::DocRouter;
|
||||||
use tokio::io::{stdin, stdout};
|
use tokio::io::{stdin, stdout};
|
||||||
use tracing_appender::rolling::{RollingFileAppender, Rotation};
|
use tracing_appender::rolling::{RollingFileAppender, Rotation};
|
||||||
use tracing_subscriber::{self, EnvFilter};
|
use tracing_subscriber::{self, EnvFilter};
|
||||||
|
|
|
@ -41,6 +41,12 @@ pub struct DocRouter {
|
||||||
cache: DocCache,
|
cache: DocCache,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for DocRouter {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl DocRouter {
|
impl DocRouter {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue