Skip to content

Support overriding existing Methods Callbacks #1053

@mattsse

Description

@mattsse

Currently, it's not possible to override MethodCallback in Methods because Methods::merge fails early if a callback with the name already exists

for name in other.callbacks.keys() {
self.verify_method_name(name)?;
}

This makes it impossible to disable various callbacks dynamically when RpcModules (via server proc macro's into_rpc) are merged.

now that verify_method_name is public this could be solved by:

  • support Methods::iter and Methods::into_iter so callbacks can be inserted individually.
  • support Methods::merge_replace which replaces existing handlers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions