Category "rust"

ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-nightly' Reader: 'LLVM APPLE_1_1300.0.29.3_0') for architecture arm64

Trying to install and work with zkgroup. Build, run for specific iOS device working fine. But generic archiving is not working. Error text: ld: Invalid value (P

Ambiguous name when using three_d and egui

recently I am using three_d this crate in my project, but when I use three_d and egui in the same script it causes an ambiguous name error use three_d::*; use e

Adding Pallet-staking to frontier unresolved import `sc_rpc::Metadata`

I have used frontier-node-template from parity tech repo to setup a private evm supported network. The network is running fine, authoring blocks and connecting

Why Rust prevents from multiple mutable references?

Like in the topic, why Rust prevents from multiple mutable references? I have read chapter in rust-book, and I understand that when we have multi-threaded code

What is the difference between iter and into_iter?

I am doing the Rust by Example tutorial which has this code snippet: // Vec example let vec1 = vec![1, 2, 3]; let vec2 = vec![4, 5, 6]; // `iter()` for vecs y

How do I authenticate (bind) to ldaps using username and password with the ldap3 crate?

I am searching for a way to supply the username and password while connecting to ldaps. The examples on the documentation page for crate ldap3 seem not illustra

How to compose two calls to Regex::replace_all?

Regex::replace_all has the signature fn (text: &str) -> Cow<str>. How would two calls to this be written, f(g(x)), giving the same signature? Here'

windows-rs GetNamedSecurityInfoW error 87

I'm trying to use windows-rs to use GetNamedSecurityInfoW microsoft api docs to read file permission information, but I keep getting error code 87 corresponds t

Compare enums only by variant, not value

I have an enum with the following structure: enum Expression { Add(Add), Mul(Mul), Var(Var), Coeff(Coeff) } where the 'members' of each varia

Global function pointer to a method errors "mismatched types"

I want to make a global function pointer pointing to a class method, so I did something like the following minimal reproducible example: struct Foo<'a> {

How to build an Apache Arrow message containing a list of structs with arrow-rs?

I'm using the arrow-rs crate (version 4.4) to declared the following schema: Schema::new(vec![ Field::new("name", DataType::Utf8, false),

Need a dynamic size buffer when listening to a udpsocket

This is the current code listening to the udpsocket at port: 34254 use std::net::UdpSocket; use std::str; fn main() -> std::io::Result<()> { {

egui combobox vector for selected

I am trying to use a vector instead of the enum specified in the docs but I have no clue how to implement the selected part. My current code is egui::ComboBox::

How would i run a Rust program without a window only when it's in release mode [duplicate]

I have a Rust project I'm currently working on and I frequently have to debug and deploy it. While it's deployed it runs in the background wit

Could not find `Cargo.toml` running Cargo in docker container

I am using the code: docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ --mount type=volume,s

How to benchmark memory usage of a function?

I notice that Rust's test has a benchmark mode that will measure execution time in ns/iter, but I could not find a way to measure memory usage. How would I imp

How to send JSON as response in tokio & warp?

I want to post the string into the server and deserialize it and send back JSON object via warp. It works fine with strings but it wont send JSON messages to We

Deserializer never called when field is not present

I have a custom serializer and deserializer. where the a field is of type Option<i32> and turns into stringified "i32" when serializing or skips the field

Why do sender and minter should be same on minting NFT?

I am developing NFT marketplace with terra and I use CW721. And I noticed on mint function if the sender and minter is not equal it returns "Unauthorized" error

How can I convert a buffer of a slice of bytes (&[u8]) to an integer?

I am reading raw data from a file and I want to convert it to an integer: fn main() { let buf: &[u8] = &[0, 0, 0, 1]; let num = slice_to_i8(buf