Skip to content

Passing params as struct using derive-macro #681

@ababo

Description

@ababo

Is there a way to pass method params through single struct (for sake of extensibility and flexibility), i.e. something like

#[rpc]
pub trait ServerApi {
    fn foo(&self, params: FooParams) -> Result<FooReply>;
}

struct FooParams {
    bar: String,
}

So now I can call {"jsonrpc":"2.0","id":123,"method":"foo","params":{"bar": "buzz"}}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions