Replies: 1 comment 2 replies
-
I briefly checked https://github.com/gluesql/gluesql/blob/main/pkg/javascript/src/lib.rs, the JS api of that Rust crate to see what it looks like. Looks like it has only several functions instead of many. Then in that case, I guess manually mirror some methods are quicker. (But if you need to mirror a ton of functions, maybe consider scanning the crate automatically.)
Firstly, fn plan<Sql: AsRef<str>>(&mut self, sql: Sql) may be fn plan(&mut self, sql: String) Secondly, generics are not supported yet (thus the This doc may be related as well: https://github.com/fzyzcjy/flutter_rust_bridge/blob/feat/12337/website/docs/guides/third-party/manual/wrappers.md EDIT: Oh I realize you are 3rd contributor to that repo! Then the answer depends on your needs. For example, originally I thought you are an user, then I suggest creating small API that suffices your needs; but if you are package contributor and want to add official Dart/Flutter support, then that would be another story - e.g. whether you want to expose to users a very rich API. EDIT: I see the PR gluesql/gluesql#1503 code. For things like https://github.com/devgony/gluesql/blob/6d059cb1314a97f87b43bb1246a093d6bcb49f8f/pkg/dart/rust/src/api/value.rs#L12, I think it can be automatically scanned. For complex things like the generic I am modifying doc about this, thus please refer to https://github.com/fzyzcjy/flutter_rust_bridge/tree/feat/12337/website/docs/guides/third-party for latest before it is merged. |
Beta Was this translation helpful? Give feedback.
-
First of all, Could you please check if i can use automatic third-party scanning for this crate
If not, I want to mirror these methods with Trait bounds
But it gets
Doesn't it support
#[frb(external)]
with Trait bound?Do you know how to solve it?
Beta Was this translation helpful? Give feedback.
All reactions