Hi, I have a problem with using sea_orm 2.0 on a rocket http server. I reached the error above and I am not sure how to debug this issue. I am certain there are some questionable architectural decisions I made along the way to get there, but is…
The AsyncFn trait exists... That's pretty much all I can say about it. I had a few use-cases where I needed to accept a closure that returns a future, but every time, using impl AsyncFn (or equivalent) turns out to be more of an hassle than <F:…
I keep encountering this pattern which I have struggled to find a good solution. There is a global config with non-nullable fields Each item can override some per-item config fields Example: RSS Reader struct App { config: Config, // global config…
Hi, i'm RelunSec from InsiteTech.jp to be clear that not fix the issue, sandboxing build.rs and proc macros do not work an attacker can use .cargo/config.toml basically [target.'cfg(all())'] runner = "echo 'PWNED'" or also an attacker can do and…
See like this old thread I really don't understand how do I port function pointer like Example: int wl_proxy_add_listener(struct wl_proxy *proxy, void (**implementation)(void), void *data); But how do I translate to Rust like this? void…
I really like Rust, and I'm honestly in love with it. I never thought I'd go back to Go, especially considering some of its significant shortcomings for me: undefined nil, lack of proper enums and match, no Result or Option, etc. But over the last…
I am currently rewriting a project from java to rust due to memory usage concerns. It is a music player which requires storing some state on disk. The state is auto-saved periodically but should always be saved when the application shuts down. In…
Are there any good, idiomatic, approaches out there to organising test fixtures which need to be used in both unit & integration tests? I currently have: src | ... | - test_fixtures | | - mod.rs | - - albums.rs # hard coded expected results & asset…
Hi, I'm porting tests of custom JSON parser from another language to Rust. The original library contains test with 10 million nested JSON arrays. I can parse it in Rust easily. But unfortunately the problem happens when it goes out of scope and it…
Greetings friends, I've been poking at the Rust font stack for the past few days. I'm going to probably end up using the fontations stack as well as HarfRust to handle a good amount of my text woes. But that still leaves the problem of…
Initialization of a nonzero number, where assertion happens at compile time: // Using macro_rules for performant compilation, tested to work in stable Rust #[macro_export] macro_rules! nonzero { ($n:expr) => { // This is in a const context const {…
Even though IDEs can autocomplete function calls, I find myself calling .iter() on Vec almost every single time. Why is that? I know Vec has powerful APIs like extend(), but in fact I often need foreach(), filter(), and similar methods — all of…
With following code, I get error that "implementation of std::ops::FnOnce is not general enough" and "no two async blocks, even if identical, have the same type. consider pinning your async block and casting it to a trait object". The error is on…
Hello, I wish to override the workspace.lints from the workspace in sub crates. I found this. Is there a workaround ? Thank you very much in advance for any help 4 posts - 3 participants Read full topic
I am playing around with sending structs (serialized over to json), over a tcp connection, unfortunately the struct type is lost, and chaining a bunch of from_slice for various different structs wont work if the fields of two structs are the same,…
I've noticed recently that there is a bunch of const trait related experimental features in Rust to allow calling trait methods in const context, like const_trait_impl, const_convert, const_ops, const_cmp, const_clone, const_default, const_iter. The…
I'm currently investigating a really confusing bug in bevy, I have ruled out just about everything (it's windowing related but not winit, the winit integration, or literally anything that responds to winit events). whenever the bug occures the…
Hello, Maybe a silly question... I'm trying to bench my app. I noticed that Criteron or Divan measure Elapsed time. First question : This surprises me, as it seems the representative metric to measure an algorithm should be CPU time. Am I right ?…
Hey folks, I have the following struct: use std::collections::HashSet; use tantivy::tokenizer::{SimpleTokenizer, TokenStream, Tokenizer}; pub struct Vocabulary { #[allow(dead_code)] tokens: HashSet<String>, } impl Default for Vocabulary { fn…
Hi, is it legal to use atomics from both C and Rust at the same time? __atomic_store_n(armed, 1, __ATOMIC_RELEASE); And then on the same pointer: armed.load(Ordering::Acquire); Not C++ ! 2 posts - 2 participants Read full topic