Skip to content

[FEATURE] [RPC] Implement Router and Handler Trait #40

@hulxv

Description

@hulxv

Description

Create the routing system and handler trait that forms the core of the RPC framework.

Motivation

Allow users to register handlers for different RPC methods with type safety.

Proposed Solution

pub trait Handler: Send + Sync {
    fn call(&self, req: Request) -> BoxFuture<'static, Result<Response>>;
}

pub struct Router {
    routes: Map<String, Box<dyn Handler>>,
}

Tasks

  • Design Handler trait
  • Implement Router
  • Add route registration
  • Support wildcard routes
  • Add route conflict detection
  • Write tests for routing logic
  • Document routing behavior

Expected

  • Type-safe handler registration
  • Efficient route lookup
  • Conflict detection
  • Wildcard support

Dependencies:

Metadata

Metadata

Assignees

No one assigned

    Labels

    coinswap-migration-phase-2The 2nd phase in integration of mill-io inside CoinswapenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions