chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715)
* chore: add #[non_exhaustive] to reduce backwards-incompatible changes going forward * fix: remove ProtocolVersion import * fix: add a few more with_ mutator methods --------- Co-authored-by: Alex Hancock <alexhancock@block.xyz>
This commit is contained in:
parent
79834b6211
commit
f63718d202
1 changed files with 1568 additions and 1110 deletions
|
|
@ -17,7 +17,7 @@ use std::time::Duration;
|
|||
use futures::StreamExt;
|
||||
use rmcp::{
|
||||
RoleServer, ServerHandler,
|
||||
model::{Implementation, ProtocolVersion, ServerCapabilities, ServerInfo, ToolsCapability},
|
||||
model::{Implementation, ServerCapabilities, ServerInfo, ToolsCapability},
|
||||
service::NotificationContext,
|
||||
transport::streamable_http_server::{
|
||||
StreamableHttpServerConfig, StreamableHttpService, session::local::LocalSessionManager,
|
||||
|
|
@ -45,20 +45,14 @@ impl TestServer {
|
|||
|
||||
impl ServerHandler for TestServer {
|
||||
fn get_info(&self) -> ServerInfo {
|
||||
ServerInfo {
|
||||
protocol_version: ProtocolVersion::LATEST,
|
||||
capabilities: ServerCapabilities::builder()
|
||||
ServerInfo::new(
|
||||
ServerCapabilities::builder()
|
||||
.enable_tools_with(ToolsCapability {
|
||||
list_changed: Some(true),
|
||||
})
|
||||
.build(),
|
||||
server_info: Implementation {
|
||||
name: "test-server".to_string(),
|
||||
version: "1.0.0".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
instructions: None,
|
||||
}
|
||||
)
|
||||
.with_server_info(Implementation::new("test-server", "1.0.0"))
|
||||
}
|
||||
|
||||
async fn on_initialized(&self, context: NotificationContext<RoleServer>) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue