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

Static Methods #151

Open
cputnam-a11y opened this issue Aug 22, 2024 · 0 comments
Open

Static Methods #151

cputnam-a11y opened this issue Aug 22, 2024 · 0 comments

Comments

@cputnam-a11y
Copy link

Are static methods in the plan for the future?

use deno_bindgen::deno_bindgen;

#[deno_bindgen]
struct Foo {
    
}
#[deno_bindgen] 
impl Foo {
    #[constructor]
    pub fn new() -> Foo {
        Self {}
    }
    pub fn bar(&self) -> String {
        "Hello from Rust!".to_string()
    }
}
#[deno_bindgen]
impl Foo {
    pub fn baz() -> String {
        "Hello from Rust!".to_string()
    }
    
}

this code produces the following error:

called `Result::unwrap()` on an `Err` value: MissingReceiver
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