-
Notifications
You must be signed in to change notification settings - Fork 256
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
Implement impl ... for ...
(partial)
#1895
Conversation
Hi! Thanks for opening this pull request! 😄 |
Then maybe
It is auto generated (by commands above), no worries |
Hopefully, this feature could be achieved soon. In my case, there is an enum like this: #[derive(Debug)]
pub enum ProxyNodeEnum {
Trojan(TrojanNode),
VMess(VMessNode),
VLESS(VLessNode),
}
impl ProxyNode for ProxyNodeEnum {
....
fn hostname(&self) -> &str {
match self {
ProxyNodeEnum::Trojan(node) => &node.hostname,
ProxyNodeEnum::VMess(node) => &node.host,
ProxyNodeEnum::VLESS(node) => &node.hostname,
}
}
fn port(&self) -> u16 {
match self {
ProxyNodeEnum::Trojan(node) => node.port,
ProxyNodeEnum::VMess(node) => node.port,
ProxyNodeEnum::VLESS(node) => node.port,
}
}
} and there is an API return |
This is needed when implementing auto scanning of external types, thus I will continue on it. I will merge to feat/12137 and continue there. |
@all-contributors please add @NobodyForNothing for code,doc |
I've put up a pull request to add @NobodyForNothing! 🎉 |
… into impl-for # Conflicts: # frb_codegen/src/library/codegen/generator/api_dart/spec_generator/function.rs # frb_codegen/src/library/codegen/parser/function_extractor.rs # frb_codegen/src/library/codegen/parser/function_parser/mod.rs # frb_codegen/src/library/codegen/parser/function_parser/output.rs # frb_example/gallery/lib/src/rust/frb_generated.dart # frb_example/gallery/rust/src/frb_generated.rs
Hi! Congrats on merging your first pull request! 🎉 |
impl ... for ...
impl ... for ...
(partial)
Changes
Generates methods when implementing traits for structs.
Fixes #1894
Also Fixes a typo on the website.
Checklist
./frb_internal precommit --mode slow
(orfast
) is run (it internal runs code generator, does auto formatting, etc)../website
folder) are updated.Running
./frb_internal precommit --mode slow
locally always results in compilation errors/panics and changes a bunch of tracked files, even on the master branch. It would be great if someone could help me resolve this.I'm also unsure how to use twin tests and left that part out.