rust-crates

Crate cannot find path

↘锁芯ラ 提交于 2020-01-06 12:17:40
问题 I am trying to use this crate to generate an ethereum address: https://docs.rs/ethkey/0.2.5/ethkey/ use ethkey::prelude::*; fn main() { let key = EthAccount::load_or_generate("~/", "passwd") .expect("should load or generate new eth key"); println!("{:?}", key.address()) } This is the example from the documentation and it doesnt seem to work. I get the error below: cargo run Compiling ethkey v0.1.0 (/Users/samueldare/Documents/Code/Thor/ethkey) Finished dev [unoptimized + debuginfo] target(s)

Crate cannot find path

一笑奈何 提交于 2020-01-06 12:17:14
问题 I am trying to use this crate to generate an ethereum address: https://docs.rs/ethkey/0.2.5/ethkey/ use ethkey::prelude::*; fn main() { let key = EthAccount::load_or_generate("~/", "passwd") .expect("should load or generate new eth key"); println!("{:?}", key.address()) } This is the example from the documentation and it doesnt seem to work. I get the error below: cargo run Compiling ethkey v0.1.0 (/Users/samueldare/Documents/Code/Thor/ethkey) Finished dev [unoptimized + debuginfo] target(s)

Crate cannot find path

橙三吉。 提交于 2020-01-06 12:17:04
问题 I am trying to use this crate to generate an ethereum address: https://docs.rs/ethkey/0.2.5/ethkey/ use ethkey::prelude::*; fn main() { let key = EthAccount::load_or_generate("~/", "passwd") .expect("should load or generate new eth key"); println!("{:?}", key.address()) } This is the example from the documentation and it doesnt seem to work. I get the error below: cargo run Compiling ethkey v0.1.0 (/Users/samueldare/Documents/Code/Thor/ethkey) Finished dev [unoptimized + debuginfo] target(s)

Error installing a crate via cargo: specified package has no binaries

删除回忆录丶 提交于 2019-12-28 04:00:16
问题 I'm trying to install a Rust crate on my system (Arch Linux) using Cargo. I can search for crates and find what I need, for example: $ cargo search curl | head -n3 Updating registry `https://github.com/rust-lang/crates.io-index` curl (0.3.0) Rust bindings to libcurl for making HTTP requests curl-sys (0.2.0) Native bindings to the libcurl library When I try to install it, I get the following error: $ cargo install curl Updating registry `https://github.com/rust-lang/crates.io-index` error:

How to use a local unpublished crate?

孤人 提交于 2019-12-17 08:45:05
问题 I've made a library: cargo new my_lib and I want to use that library in a different program: cargo new my_program --bin extern crate my_lib; fn main { println!("Hello, World!"); } what do I need to do to get this to work? They aren't in the same project folder. . ├── my_lib └── my_program Hopefully this makes sense. I thought I'd be able to override the path as per the Cargo guide, but it states You cannot use this feature to tell Cargo how to find local unpublished crates. This is when using

cargo build of the same code: spurious compile time errors?

丶灬走出姿态 提交于 2019-12-10 15:29:27
问题 I have crate A that depend on B and B depend on rust-nmea crate. If I build crate A I got bunch of errors (all of them that missed use std::error::Error; ) during build of rust-nmea dependency: error[E0599]: no method named `description` found for type `nom::Err<&[u8]>` in the current scope --> /home/evgeniy/.cargo/registry/src/github.com-1ecc6299db9ec823/nmea-0.0.6/src/parse.rs:100:44 | 100 | IError::Error(e) => e.description().to_string(), | ^^^^^^^^^^^ | = help: items from traits can only

Should end user utilities/applications be registered on crates.io?

血红的双手。 提交于 2019-12-06 03:31:09
问题 Is it acceptable to register generally useful (utilities / applications) on crates.io? The FAQ doesn't address this and from browsing, there are examples of end-user applications (mostly command line tools). Or is crates.io? meant only for libraries? I'm asking this because the documentation hints at library use, semantic versioning for API's etc. but doesn't reference the case for packaging applications explicitly. 回答1: Yes, because you can use cargo install to install and manage those

Should end user utilities/applications be registered on crates.io?

萝らか妹 提交于 2019-12-04 07:29:51
Is it acceptable to register generally useful (utilities / applications) on crates.io ? The FAQ doesn't address this and from browsing, there are examples of end-user applications (mostly command line tools). Or is crates.io? meant only for libraries? I'm asking this because the documentation hints at library use, semantic versioning for API's etc. but doesn't reference the case for packaging applications explicitly. Yes, because you can use cargo install to install and manage those applications system-wide. If this use were discouraged, I would suspect that command to not exist at all, or at

How do I share common code between Rust projects without publishing to crates.io?

走远了吗. 提交于 2019-11-30 17:37:54
There may not be a good answer for this question, but I have code that I would like to share between two different Rust projects WITHOUT publishing the crate to crates.io. The code is proprietary and I don't want to put it out into the wild. but it's proprietary code and I don't want to put it out into the wild. You don't have to publish a crate. Specifically, just create the crate ( cargo new shared_stuff ) then specify the path to the common crate(s) in the dependent project's Cargo.toml : [dependency.shared_stuff] path = "path/to/shared/crate" The Cargo documentation has an entire section

How do I share common code between Rust projects without publishing to crates.io?

一曲冷凌霜 提交于 2019-11-30 16:44:17
问题 There may not be a good answer for this question, but I have code that I would like to share between two different Rust projects WITHOUT publishing the crate to crates.io. The code is proprietary and I don't want to put it out into the wild. 回答1: but it's proprietary code and I don't want to put it out into the wild. You don't have to publish a crate. Specifically, just create the crate ( cargo new shared_stuff ) then specify the path to the common crate(s) in the dependent project's Cargo