lambdacat / flatbuffers-rs Goto Github PK
View Code? Open in Web Editor NEWRuntime for flatbuffers in rust.
Runtime for flatbuffers in rust.
This is the stub README.txt for the "lambdacat" project.
It would be great if Vector lookup_by_key() was implemented!
:-)
create_vector() returns a type that can not be used: Offset<Vector<Offsettest::new_request_v2::Pair>>
I can't use it because when I use the generated add_*() method I get:
//expected `Offset<Vector<Offset<test::new_request_v2::Pair>, &new_request_v2::Pair>>`,
//found `Offset<Vector<Offset<test::new_request_v2::Pair>>>`
So Vector<> needs to be constructed with T, I. create_vector() needs a different return type?
This is the generated add_*() fn:
pub fn add_x(&mut self, x: fb::Offsetfb::Vector<fb::Offset<Pair, &Pair>>)
I tried to create a new create_vector() but it required lifetimes, and these lifetimes trickled down into problems with Indirect impls etc. so I don't think that's what we want.
Suggestions?
Thanks!
create_vector() returns a type that can not be used:
Offset<Vector<Offset<test::new_request_v2::Pair>>>
I can't use it because when I use the generated add_*() method I get:
//expected `Offset<Vector<Offset<test::new_request_v2::Pair>, &new_request_v2::Pair>>`,
//found `Offset<Vector<Offset<test::new_request_v2::Pair>>>`
So Vector<> needs to be constructed with T, I. create_vector() needs a different return type?
This is the generated add_*() fn:
pub fn add_x(&mut self, x: fb::Offsetfb::Vector<fb::Offset<Pair, &Pair>>)
I tried to create a new create_vector() but it required lifetimes, and these lifetimes trickled down into problems with Indirect impls etc. so I don't think that's what we want.
Suggestions?
Thanks!
Ok, just tossing out a couple of ideas wrt lifetimes and safety:
I would prefer not to rely on unbounded lifetimes.
Would anyone object to a patch? Is this project still maintained?
true and false are reversed in the generated code.
I'll submit a pull request shortly.
Edit: Note to others: I had to patch arbitrary-cat's "flatbuffer" rust-gen branch (not the "flatbuffer-rs" git repo).
So when you want to build a flatc that generates Rust code that correctly deals with bool, you'll need to use my "rust-fix-bool" branch:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.