我正在尝试创建一个包含库和一个或多个二进制文件的板条箱。我看过带有库和二进制文件的 Rust 包?以及关于 crates 和模块的 Rust 书籍部分,但是当我尝试编译时仍然遇到错误。
我已经包含了每个文件的相关部分(我认为)。
../cargo.toml:
[package]
name = "plotmote"
version = "0.1.0"
authors = ["Camden Narzt <my@nice.email>"]
[lib]
name = "lib_plotMote"
path = "src/lib.rs"
[[bin]]
name = "plotMote"
path = "src/main.rs"
lib.rs:
pub mod lib_plotMote;
lib_plotMote/mod.rs:
pub mod LogstreamProcessor;
lib_plotMote/LogstreamProcessor.rs:
pub struct LogstreamProcessor {
main.rs:
extern crate lib_plotMote;
use lib_plotMote::LogStreamProcessor;
错误:
cargo build
Compiling plotmote v0.1.0 (file:///Users/camdennarzt/Developer/Rust/plotmote)
main.rs:6:5: 6:37 error: unresolved import `lib_plotMote::LogStreamProcessor`. There is no `LogStreamProcessor` in `lib_plotMote` [E0432]