Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic parameters and trait bounds on trait methods not preserved in derived client impl #617

Open
dbw9580 opened this issue Mar 7, 2021 · 0 comments

Comments

@dbw9580
Copy link

dbw9580 commented Mar 7, 2021

#[rpc]
pub trait Processor {
    #[rpc(name="add")]
    fn add_item<C: Config + Serialize>(&self, item: Item<C>) -> Result<()>;
}

gets expanded to

impl Client {
    pub fn add_item(&self, item: Item<C>) -> impl Future<Output = RpcResult<()>> {
        let args = (item,);
        self.inner.call_method("add", "()", args)
    }
}

which leads to compilation error.

@dbw9580 dbw9580 changed the title Generic parameters and trait bounds not preserved in derived client impl Generic parameters and trait bounds on trait methods not preserved in derived client impl Mar 7, 2021
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

No branches or pull requests

1 participant