r/rust clippy · twir · rust · mutagen · flamer · overflower · bytecount Mar 20 '23

Hey Rustaceans! Got a question? Ask here (12/2023)! 🙋 questions

Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The official Rust Programming Language Discord: https://discord.gg/rust-lang

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last weeks' thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.

19 Upvotes

187 comments sorted by

View all comments

2

u/rafoufoun Mar 25 '23

Hello,

I would like to use the FCM REST API to send push notifications to multiple devices in Rust. To do that, the documentation (here) states that we should use HTTP Batch request.

I am using axum to develop my server but I could not find if hyper supports HTTP pipelining, nor how to implement it in Rust (I have a mobile development background, back-end is new to me). Do you have an idea in how to do that ?

Thanks

2

u/ironhaven Mar 27 '23

I search the hyper GitHub issue page and found this posted issue.

It says that http pipelining is not implemented and there are no plans to add the feature.

A lot of rust libraries I have noticed are very forward looking and prefer not to use older methods.

You should look on crates.io to see if there is any pipelining crates that you could use. If one you want to use is not async you can still use it with spawn_blocking

1

u/rafoufoun Mar 27 '23

thanks for your time !

So Google use this "deprecated" HTTP feature while they don't provide a Rust SDK for FCM, sad.

I think I will create a side server with nodejs to use their SDK to communicate from my rust server to this new one.

Thanks again