style: fmt the project (#54)
add rustfmt.toml Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
This commit is contained in:
parent
59bfb6e748
commit
0a2f13a1f4
36 changed files with 158 additions and 132 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
|
@ -41,11 +41,11 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install Rust fmt
|
||||
run: rustup toolchain install nightly --component rustfmt
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
run: cargo +nightly fmt --all -- --check
|
||||
|
||||
clippy:
|
||||
name: Lint with Clippy
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[workspace]
|
||||
members = ["crates/rmcp", "crates/rmcp-macros", "examples/*"]
|
||||
resolver = "2"
|
||||
|
|
@ -12,7 +14,7 @@ version = "0.1.5"
|
|||
authors = ["4t145 <u4t145@163.com>"]
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/modelcontextprotocol/rust-sdk/"
|
||||
description = "Rust SDK for the Model Context Protocol"
|
||||
description = "Rust SDK for Model Context Protocol"
|
||||
keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"]
|
||||
homepage = "https://github.com/modelcontextprotocol/rust-sdk"
|
||||
categories = [
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "rmcp-macros"
|
||||
license.workspace = true
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
readme.workspace = true
|
||||
license = { workspace = true }
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
readme = { workspace = true }
|
||||
description = "Rust SDK for Model Context Protocol macros library"
|
||||
documentation = "https://docs.rs/rmcp-macros"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "rmcp"
|
||||
license.workspace = true
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
readme.workspace = true
|
||||
license = { workspace = true }
|
||||
version = { workspace = true }
|
||||
edition = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
readme = { workspace = true }
|
||||
description = "Rust SDK for Model Context Protocol"
|
||||
documentation = "https://docs.rs/rmcp"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
use crate::error::Error as McpError;
|
||||
use crate::model::*;
|
||||
use crate::service::{Peer, RequestContext, RoleClient, Service, ServiceRole};
|
||||
use crate::{
|
||||
error::Error as McpError,
|
||||
model::*,
|
||||
service::{Peer, RequestContext, RoleClient, Service, ServiceRole},
|
||||
};
|
||||
|
||||
impl<H: ClientHandler> Service<RoleClient> for H {
|
||||
async fn handle_request(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
use crate::error::Error as McpError;
|
||||
use crate::model::*;
|
||||
use crate::service::{Peer, RequestContext, RoleServer, Service, ServiceRole};
|
||||
use crate::{
|
||||
error::Error as McpError,
|
||||
model::*,
|
||||
service::{Peer, RequestContext, RoleServer, Service, ServiceRole},
|
||||
};
|
||||
|
||||
mod resource;
|
||||
pub mod tool;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ pub use error::Error;
|
|||
pub mod model;
|
||||
#[cfg(any(feature = "client", feature = "server"))]
|
||||
pub mod service;
|
||||
#[cfg(feature = "client")]
|
||||
pub use handler::client::ClientHandler;
|
||||
#[cfg(feature = "server")]
|
||||
pub use handler::server::ServerHandler;
|
||||
#[cfg(any(feature = "client", feature = "server"))]
|
||||
pub use service::{Peer, Service, ServiceError, ServiceExt};
|
||||
#[cfg(feature = "client")]
|
||||
|
|
@ -13,21 +17,15 @@ pub use service::{RoleClient, serve_client};
|
|||
#[cfg(feature = "server")]
|
||||
pub use service::{RoleServer, serve_server};
|
||||
|
||||
#[cfg(feature = "client")]
|
||||
pub use handler::client::ClientHandler;
|
||||
#[cfg(feature = "server")]
|
||||
pub use handler::server::ServerHandler;
|
||||
|
||||
pub mod handler;
|
||||
pub mod transport;
|
||||
|
||||
#[cfg(all(feature = "macros", feature = "server"))]
|
||||
pub use rmcp_macros::tool;
|
||||
|
||||
// re-export
|
||||
#[cfg(all(feature = "macros", feature = "server"))]
|
||||
pub use paste::paste;
|
||||
#[cfg(all(feature = "macros", feature = "server"))]
|
||||
pub use rmcp_macros::tool;
|
||||
#[cfg(all(feature = "macros", feature = "server"))]
|
||||
pub use schemars;
|
||||
#[cfg(feature = "macros")]
|
||||
pub use serde;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ pub use capabilities::*;
|
|||
pub use content::*;
|
||||
pub use prompt::*;
|
||||
pub use resource::*;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
pub use tool::*;
|
||||
|
|
@ -964,9 +963,10 @@ impl From<CancelledNotification> for ClientNotification {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_notification_serde() {
|
||||
let raw = json!( {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{
|
||||
RawContent, RawEmbeddedResource, RawImageContent, RawResource, RawResourceTemplate,
|
||||
RawTextContent, Role,
|
||||
};
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
use super::JsonObject;
|
||||
use std::{collections::BTreeMap, marker::PhantomData};
|
||||
|
||||
use paste::paste;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::BTreeMap;
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use super::JsonObject;
|
||||
pub type ExperimentalCapabilities = BTreeMap<String, JsonObject>;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
//! Content sent around agents, extensions, and LLMs
|
||||
//! The various content types can be display to humans but also understood by models
|
||||
//! They include optional annotations used to help inform agent usage
|
||||
use super::resource::ResourceContents;
|
||||
use super::{AnnotateAble, Annotated};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
|
||||
use super::{AnnotateAble, Annotated, resource::ResourceContents};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct RawTextContent {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
use super::content::{EmbeddedResource, ImageContent};
|
||||
use super::resource::ResourceContents;
|
||||
use super::{AnnotateAble, Annotations, RawEmbeddedResource, RawImageContent};
|
||||
use base64::engine::{Engine, general_purpose::STANDARD as BASE64_STANDARD};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::{
|
||||
AnnotateAble, Annotations, RawEmbeddedResource, RawImageContent,
|
||||
content::{EmbeddedResource, ImageContent},
|
||||
resource::ResourceContents,
|
||||
};
|
||||
|
||||
/// A prompt that can be used to generate text from a model
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
use crate::error::Error as McpError;
|
||||
use crate::model::{
|
||||
CancelledNotification, CancelledNotificationParam, JsonRpcMessage, Message, RequestId,
|
||||
};
|
||||
use crate::transport::IntoTransport;
|
||||
use futures::future::BoxFuture;
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::{
|
||||
error::Error as McpError,
|
||||
model::{
|
||||
CancelledNotification, CancelledNotificationParam, JsonRpcMessage, Message, RequestId,
|
||||
},
|
||||
transport::IntoTransport,
|
||||
};
|
||||
#[cfg(feature = "client")]
|
||||
mod client;
|
||||
#[cfg(feature = "client")]
|
||||
|
|
@ -15,10 +18,9 @@ mod server;
|
|||
pub use server::*;
|
||||
#[cfg(feature = "tower")]
|
||||
mod tower;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
#[cfg(feature = "tower")]
|
||||
pub use tower::*;
|
||||
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::instrument;
|
||||
#[derive(Error, Debug)]
|
||||
#[non_exhaustive]
|
||||
|
|
@ -189,11 +191,12 @@ impl<R: ServiceRole, S: Service<R>> DynService<R> for S {
|
|||
}
|
||||
}
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::AtomicU32;
|
||||
use std::time::Duration;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
ops::Deref,
|
||||
sync::{Arc, atomic::AtomicU32},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
use futures::{SinkExt, StreamExt};
|
||||
|
||||
use super::*;
|
||||
use crate::model::{
|
||||
CallToolRequest, CallToolRequestParam, CallToolResult, CancelledNotification,
|
||||
CancelledNotificationParam, ClientInfo, ClientMessage, ClientNotification, ClientRequest,
|
||||
|
|
@ -12,9 +15,6 @@ use crate::model::{
|
|||
UnsubscribeRequest, UnsubscribeRequestParam,
|
||||
};
|
||||
|
||||
use super::*;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
||||
pub struct RoleClient;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
use futures::{SinkExt, StreamExt};
|
||||
|
||||
use super::*;
|
||||
use crate::model::{
|
||||
CancelledNotification, CancelledNotificationParam, ClientInfo, ClientNotification,
|
||||
ClientRequest, ClientResult, CreateMessageRequest, CreateMessageRequestParam,
|
||||
|
|
@ -8,9 +11,6 @@ use crate::model::{
|
|||
ServerResult, ToolListChangedNotification,
|
||||
};
|
||||
|
||||
use super::*;
|
||||
use futures::{SinkExt, StreamExt};
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
||||
pub struct RoleServer;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ use tokio::{
|
|||
process::{ChildStdin, ChildStdout},
|
||||
};
|
||||
|
||||
use crate::service::{RxJsonRpcMessage, ServiceRole, TxJsonRpcMessage};
|
||||
|
||||
use super::IntoTransport;
|
||||
use crate::service::{RxJsonRpcMessage, ServiceRole, TxJsonRpcMessage};
|
||||
|
||||
pub(crate) fn child_process(
|
||||
mut child: tokio::process::Child,
|
||||
|
|
|
|||
|
|
@ -4,16 +4,14 @@ use std::marker::PhantomData;
|
|||
use futures::{Sink, SinkExt, Stream, StreamExt};
|
||||
use serde::{Serialize, de::DeserializeOwned};
|
||||
use thiserror::Error;
|
||||
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio_util::{
|
||||
bytes::{Buf, BufMut, BytesMut},
|
||||
codec::{Decoder, Encoder, FramedRead, FramedWrite},
|
||||
};
|
||||
|
||||
use crate::service::{RxJsonRpcMessage, ServiceRole, TxJsonRpcMessage};
|
||||
|
||||
use super::IntoTransport;
|
||||
use crate::service::{RxJsonRpcMessage, ServiceRole, TxJsonRpcMessage};
|
||||
|
||||
#[cfg(feature = "transport-io")]
|
||||
/// # StdIO Transport
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
//! reference: https://html.spec.whatwg.org/multipage/server-sent-events.html
|
||||
use crate::model::{ClientJsonRpcMessage, ServerJsonRpcMessage};
|
||||
use std::{collections::VecDeque, sync::Arc, time::Duration};
|
||||
|
||||
use futures::{FutureExt, Sink, Stream, StreamExt, future::BoxFuture, stream::BoxStream};
|
||||
use reqwest::{
|
||||
Client as HttpClient, IntoUrl, Url,
|
||||
header::{ACCEPT, HeaderValue},
|
||||
};
|
||||
use sse_stream::{Error as SseError, Sse, SseStream};
|
||||
use std::{collections::VecDeque, sync::Arc, time::Duration};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::model::{ClientJsonRpcMessage, ServerJsonRpcMessage};
|
||||
const MIME_TYPE: &str = "text/event-stream";
|
||||
const HEADER_LAST_EVENT_ID: &str = "Last-Event-ID";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
use crate::{
|
||||
RoleServer, Service,
|
||||
model::ClientJsonRpcMessage,
|
||||
service::{RxJsonRpcMessage, TxJsonRpcMessage},
|
||||
};
|
||||
use std::{collections::HashMap, net::SocketAddr, sync::Arc};
|
||||
|
||||
use axum::{
|
||||
Json, Router,
|
||||
extract::{Query, State},
|
||||
|
|
@ -14,13 +11,16 @@ use axum::{
|
|||
routing::{get, post},
|
||||
};
|
||||
use futures::{Sink, SinkExt, Stream, StreamExt};
|
||||
use std::{collections::HashMap, net::SocketAddr};
|
||||
use tokio::io;
|
||||
use tokio_stream::wrappers::ReceiverStream;
|
||||
use tokio_util::sync::{CancellationToken, PollSender};
|
||||
use tracing::Instrument;
|
||||
|
||||
use std::sync::Arc;
|
||||
use tokio::io;
|
||||
use crate::{
|
||||
RoleServer, Service,
|
||||
model::ClientJsonRpcMessage,
|
||||
service::{RxJsonRpcMessage, TxJsonRpcMessage},
|
||||
};
|
||||
type SessionId = Arc<str>;
|
||||
type TxStore =
|
||||
Arc<tokio::sync::RwLock<HashMap<SessionId, tokio::sync::mpsc::Sender<ClientJsonRpcMessage>>>>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use rmcp::{ServerHandler, handler::server::tool::ToolCallContext, tool};
|
||||
use schemars::JsonSchema;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, JsonSchema)]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "mcp-client-examples"
|
||||
version = "0.1.5"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::Result;
|
||||
use rmcp::service::ServiceExt;
|
||||
use rmcp::{model::CallToolRequestParam, transport::TokioChildProcess};
|
||||
|
||||
use rmcp::{model::CallToolRequestParam, service::ServiceExt, transport::TokioChildProcess};
|
||||
use tokio::process::Command;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ use rmcp::{
|
|||
object,
|
||||
transport::TokioChildProcess,
|
||||
};
|
||||
|
||||
use tokio::process::Command;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
use anyhow::Result;
|
||||
use rmcp::model::{ClientCapabilities, ClientInfo, Implementation};
|
||||
use rmcp::{ServiceExt, model::CallToolRequestParam, transport::SseTransport};
|
||||
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use rmcp::{
|
||||
ServiceExt,
|
||||
model::{CallToolRequestParam, ClientCapabilities, ClientInfo, Implementation},
|
||||
transport::SseTransport,
|
||||
};
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use rmcp::{model::CallToolRequestParam, service::ServiceExt, transport::TokioChildProcess};
|
||||
|
||||
use tokio::process::Command;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "rig-integration"
|
||||
edition.workspace = true
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
keywords.workspace = true
|
||||
homepage.workspace = true
|
||||
categories.workspace = true
|
||||
readme.workspace = true
|
||||
edition = { workspace = true }
|
||||
version = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
description = { workspace = true }
|
||||
keywords = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
categories = { workspace = true }
|
||||
readme = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
rig-core = "0.10.0"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "mcp-server-examples"
|
||||
version = "0.1.5"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
use rmcp::transport::sse_server::SseServer;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
use tracing_subscriber::{self};
|
||||
use tracing_subscriber::{
|
||||
layer::SubscriberExt,
|
||||
util::SubscriberInitExt,
|
||||
{self},
|
||||
};
|
||||
mod common;
|
||||
use common::counter::Counter;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
use rmcp::transport::sse_server::{SseServer, SseServerConfig};
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
use tracing_subscriber::{self};
|
||||
use tracing_subscriber::{
|
||||
layer::SubscriberExt,
|
||||
util::SubscriberInitExt,
|
||||
{self},
|
||||
};
|
||||
mod common;
|
||||
use common::counter::Counter;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ use rmcp::{
|
|||
Error as McpError, RoleServer, ServerHandler, const_string, model::*, schemars,
|
||||
service::RequestContext, tool,
|
||||
};
|
||||
|
||||
use serde_json::json;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use anyhow::Result;
|
||||
use common::counter::Counter;
|
||||
use rmcp::{ServiceExt, transport::stdio};
|
||||
|
||||
use tracing_subscriber::{self, EnvFilter};
|
||||
mod common;
|
||||
/// npx @modelcontextprotocol/inspector cargo run -p mcp-server-examples --example std_io
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "transport"
|
||||
edition.workspace = true
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
keywords.workspace = true
|
||||
homepage.workspace = true
|
||||
categories.workspace = true
|
||||
readme.workspace = true
|
||||
edition = { workspace = true }
|
||||
version = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
description = { workspace = true }
|
||||
keywords = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
categories = { workspace = true }
|
||||
readme = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use std::fs;
|
||||
|
||||
use common::calculator::Calculator;
|
||||
use rmcp::{serve_client, serve_server};
|
||||
use std::fs;
|
||||
use tokio::net::{UnixListener, UnixStream};
|
||||
|
||||
mod common;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ use std::marker::PhantomData;
|
|||
|
||||
use common::calculator::Calculator;
|
||||
use futures::{Sink, Stream};
|
||||
|
||||
use rmcp::{
|
||||
RoleClient, RoleServer, ServiceExt,
|
||||
service::{RunningService, RxJsonRpcMessage, ServiceRole, TxJsonRpcMessage},
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
cargo-features = ["edition2024"]
|
||||
|
||||
[package]
|
||||
name = "wasi"
|
||||
edition.workspace = true
|
||||
version.workspace = true
|
||||
authors.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
description.workspace = true
|
||||
keywords.workspace = true
|
||||
homepage.workspace = true
|
||||
categories.workspace = true
|
||||
readme.workspace = true
|
||||
edition = { workspace = true }
|
||||
version = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
description = { workspace = true }
|
||||
keywords = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
categories = { workspace = true }
|
||||
readme = { workspace = true }
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
|
|
|||
6
rustfmt.toml
Normal file
6
rustfmt.toml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
newline_style = "Unix"
|
||||
unstable_features = true # Cargo fmt now needs to be called with `cargo +nightly fmt`
|
||||
group_imports = "StdExternalCrate" # Create 3 groups: std, external crates, and self.
|
||||
imports_granularity = "Crate" # Merge imports from the same crate into a single use statement
|
||||
style_edition = "2024"
|
||||
max_width = 100
|
||||
Loading…
Reference in a new issue