Skip to content

Conversation

hashemix
Copy link
Member

@hashemix hashemix commented Feb 18, 2025

📌 Summary

  • Added message_type() method to the MCPMessage Trait that returns a MessageTypes enum.
    Implemented for ClientMessage and ServerMessage enums
  • Moved the request_id() method of the MCPMessage trait into a super trait (RPCMessage) , so MCPMessage could be also implemented for types that does not necessarily have a requestId or jsonrpc version.

Example:

fn print_message_type( message: ClientMessage ){
    if message.is_request() {
        println!("This message is a Request!");
    }
}

@hashemix hashemix self-assigned this Feb 18, 2025
@hashemix hashemix merged commit aca2336 into main Feb 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant