Code Monkey home page Code Monkey logo

flatbuffers-rs's Introduction

This is the stub README.txt for the "lambdacat" project.

flatbuffers-rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flatbuffers-rs's Issues

create_vector generates the wrong type

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 generates the wrong type

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!

unbounded lifetimes and transmute

Ok, just tossing out a couple of ideas wrt lifetimes and safety:

  • we should specify lifetimes on things like get_root()
  • we should also use pointer casts instead of transmute()

I would prefer not to rely on unbounded lifetimes.
Would anyone object to a patch? Is this project still maintained?

bool is broken

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:

lambdacat/flatbuffers#4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.