Coder Social home page Coder Social logo

cloudwego / pilota Goto Github PK

View Code? Open in Web Editor NEW
112.0 112.0 15.0 1.29 MB

A thrift and protobuf implementation in pure rust with high performance and extensibility.

Home Page: https://crates.io/crates/pilota

License: Apache License 2.0

Rust 99.68% Thrift 0.32%
protobuf rust thrift

pilota's People

Contributors

bobozhengsir avatar buaazp avatar dependabot[bot] avatar ggiggle avatar ii64 avatar junhaideng avatar lyf1999 avatar mbrobbel avatar millione avatar my-vegetable-has-exploded avatar purewhitewu avatar wfly1998 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pilota's Issues

Allow `pilota.rust_type` annotation work on container type

Feature Request

Motivation

Right now in pilota, when I wrote like this:

struct A {
  1: required map<i32, string> m,
}

It will generate:

pub struct A {
  pub m: ::std::collections::HashMap<i32, ::pilota::FastStr>,
}

And there is no other way to generate code like followings as pilota.rust_type annotation cannot work on container type.

pub struct A {
  pub m: ::std::collections::HashMap<i32, String>,
}

Error when using plug-in

Bug Report

Error when using plug-in

Version

│ ├── pilota v0.8.1
│ ├── pilota v0.8.1 ()
├── pilota v0.8.1 (
)
│ ├── pilota v0.8.1 (*)
│ ├── pilota-build v0.8.4
│ │ ├── pilota-thrift-parser v0.4.2

Platform

inux codespaces-0bb6e8 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Crates

│ ├── volo v0.5.5
│ └── volo-grpc v0.6.0
│ └── volo v0.5.5 ()
│ └── volo-gen v0.1.0 (/workspaces/semen-sinapis/volo-gen)
│ ├── volo v0.5.5 (
)
│ └── volo-grpc v0.6.0 ()
│ └── volo-build v0.6.2
│ ├── volo v0.5.5 (
)
├── volo v0.5.5 ()
├── volo-gen v0.1.0 (/workspaces/semen-sinapis/volo-gen) (
)
└── volo-grpc v0.6.0 (*)

Description

When I use volo grpc, the build encounters an error,Adding the serde plug-in to the build.rs file will result in an error.

volo-gen/build.rs

fn main() {
    volo_build::ConfigBuilder::default().plugin(volo_build::plugin::SerdePlugin).write().unwrap();
}

The error message is as follows:
error[E0463]: can't find crate for serde
--> /workspaces/semen-sinapis/target/debug/build/volo-gen-b77b2808dfb60bc8/out/volo_gen.rs:11615:13
|
11615 | ::pilota::serde::Deserialize,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
|
= note: this error originates in the derive macro ::pilota::serde::Deserialize (in Nightly builds, run with -Z macro-backtrace for more info)

Make `pilota.rust_wrapper_arc` annotation wrapper Arc outside

Feature Request

Motivation

Can pilota.rust_wrapper_arc annotation support wrapper Arc like this:

struct A {

}
struct B {
  1: required list<string> a(pilota.rust_wrapper_arc="inner"),
  2: required list<string> b(pilota.rust_wrapper_arc="outer"),
}

Generated:

pub struct A {}
pub struct B {
  a: ::std::collections::Vec<::std::sync::Arc<::pilota::FastStr>>,
  b: ::std::sync::Arc<::std::collections::Vec<::pilota::FastStr>>,
}

Are you using Pilota?

The purpose of this issue

We are always interested in finding out who is using Pilota, what attracted you to using it, how we can listen to your needs and if you are interested, help promote your organization.

  • We have people reaching out to us asking, who uses Pilota in production?
  • We’d like to listen to what you would like to see in Pilota in your scenarios?
  • We'd like to help promote your organization and work with you.

What we would like from you

Submit a comment in this issue and include the following information:

  • Your organization or company
  • Link to your website
  • Your country
  • Your contact info to reach out to you: blog, email or Twitter (at least one).
  • What is your scenario for using Pilota?
  • Are you running your application in testing or production?
Organization/Company: ByteDance
Website: https://www.bytedance.com
Country: Global
Contact: [email protected]
Usage scenario: Using Pilota to build large scale Cloud Native applications
Status: Production

Thank you very much!

Support generate as_str for enums

enum A {
  A
  AB
  ABC
}

需要生成一个这样的as_str方法

enum A {
  A,
  AB,
  ABC,
}

impl A {
  pub fn as_str(self) -> &'static str {
      match self {
        A::A => "A",
        A::AB => "AB",
        A::ABC => "ABC",
      }
  }
}

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.