Questions tagged [rust-crates]

Crates are the unit of compilation in Rust.

Crates are the unit of compilation in , and the basic building block of its system.

The crates can be published in crates.io, the official Rust packages registry, where you can browse them.

206 questions
1
vote
0 answers

How to install a python shared library in rust project in windows?

crate link for reference Here they gave a command to install a python package in rust but in ubuntu only... I saw about shared libraries but idk what library to install error: process didn't exit successfully: `target\debug\pytest.exe` (exit code:…
ninetynin
  • 19
  • 1
  • 6
1
vote
1 answer

What warrants an account deletion on the NEAR Protocol

Runtime Specification listed here: https://nomicon.io/RuntimeSpec/Scenarios/FinancialTransaction#transaction-to-receipt states within the verify_and_charge_transaction method, one of the operations is supposedly to: Checks whether after all these…
1
vote
1 answer

Publicly using the public api of a third party crate?

I'd like to publicly use the public API of a third party crate while implementing a new crate. For example, suppose I'm implementing a crate my_serializer which needs some kind of u7 type. This doesn't exist in the core language, or standard library…
1
vote
0 answers

How to share a rust unpublished cdy lib into Buildroot and use it

When you create a custom rust library package into buildroot 2021, and you want to use it into another rust app package, you have to specify its path into Cargo.toml. The problem is buildroot package build path changed according to your workspace,…
L. CEREYON
  • 11
  • 1
1
vote
1 answer

Basic Error Deploy Terrain dApp on LocalTerra

I've been following this tutorial in order to deploy my first DAPP https://docs.terra.money/docs/develop/dapp/quick-start/using-terrain-localterra.html I've ran this in order to install localterra and run docker git clone --branch v0.5.2 --depth 1…
Vicorico
  • 11
  • 2
1
vote
2 answers

no new() in sha3::Keccak256 struct

I'm trying to get an ethereum public address from a hex private key. I wrote a rust script for that - extern crate hex; extern crate secp256k1; extern crate sha3; use secp256k1::{PublicKey, SecretKey}; use sha3::Keccak256; fn main() { let…
1
vote
1 answer

cargo publish "no targets specified in the manifest"

I have a library crate and want to publish it on crates.io. I created my project with cargo new my_lib --lib. My project structure looks like this: my_lib/ ├─ src/ │ ├─ lib.rs ├─ examples/ │ ├─ example.rs ├─ benches/ │ ├─ benchmark.rs ├─…
CodeF0x
  • 2,624
  • 6
  • 17
  • 28
1
vote
1 answer

Code works fine copy/pasted into my main.rs, but is ignored when run from its own external crate

tl;dr I'm trying to figure out why the avr-delay::delay function doesn't cause any delay when imported as an external crate, but when copy/pasting the code from avr-delay/src/lib.rs into my main.rs, it all works as expected and creates the 1000ms…
jamzsabb
  • 1,125
  • 2
  • 18
  • 40
1
vote
1 answer

Rust - Use module in a parent directory

I have a file structure looking somewhat like the following: src/ --clients/ ----queue_client/ ------mod.rs --data_evaluator/ ----data_evaluator.rs In data_evaluator, I want to use the queue_client module, but when I do mod queue_client in…
WhoopsBing
  • 493
  • 1
  • 6
  • 12
1
vote
0 answers

Error: could not find `rng` in `rand` when using Rust Crate `secp256k1`

I am new to rust and encountered the following error when trying to use the secp256k1 crate with the provided example code error[E0432]: unresolved import `secp256k1::rand::rng` --> src/main.rs:1:22 | 1 | use secp256k1::rand::rng::OsRng; | …
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
1
vote
0 answers

How to use a crate with a hyphen (-) in the name?

This crate's name is: name = "rtsp-types" How can I use it on my project? I added to the Cargo.toml: [dependencies] rtsp-types = { path = "../rtsp-types" } however I can't do use rtsp-types because of the - symbol.
Gatonito
  • 1,662
  • 5
  • 26
  • 55
1
vote
3 answers

How to find the git commit id of an included crate?

I have included a crate as dependency in my Cargo.toml as: bellman_ce = "=0.3.3" How do I find which commit id this version of the package points to? Unfortunately, github repo is not tagged by version number.
Shravan
  • 2,553
  • 2
  • 16
  • 19
1
vote
1 answer

Build script is unable to find crate that is listed in the [dependencies] section

Minimal reproducible example: build.rs extern crate pkg_config; fn main() {} Cargo.toml [dependencies] pkg-config = "0.3" Running cargo check or cargo build on this example results in an error: error[E0463]: can't find crate for pkg_config. Cargo…
haydnv
  • 25
  • 3
1
vote
0 answers

How to check all the available nightly builds for a cargo crate?

I would like to find out under which nightly builds can I compile my code with a specific crate (in this case rustc_ast). I know I can do it using the latest nightly (rustc 1.51.0-nightly (44e3daf5e 2020-12-31)), but I have an additional dependency…
mmagician
  • 1,970
  • 2
  • 15
  • 26
1
vote
0 answers

How to create multi version crate in Rust

I would like to create a multi-version crate. Say I creating crate for some standard, let's call it A and that standard has a couple of versions (1.0, 1.1, 1.3 ...). What I want is to create a crate were: users could select the standard version…
my-
  • 604
  • 9
  • 17