从Cargo.toml:
[package]
name = "sitegen"
version = "0.2.0"
edition = "2021"
[dependencies]
axum_database_sessions = { version = "5.0", features = [ "mysql-native"] }
sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "mysql"] }
tokio = { version = "1.0", features = ["full"] }
编译错误:
error: only one of ['runtime-actix-native-tls', 'runtime-async-std-native-tls', 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', 'runtime-tokio-rustls'] can be enabled
--> /home/dsrich/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-rt-0.6.2/src/lib.rs:23:1
|
23 | / compile_error!(
24 | | "only one of ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
25 | | 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
26 | | 'runtime-tokio-rustls'] can be enabled"
27 | | );
| |_^
error: could not compile `sqlx-rt` due to previous error
我在Linux上使用最新的rust x86-64,MySQL,在Cargo.toml中是否存在rustls没有区别。有什么建议吗?对我来说毫无意义...
只是试图编译它开始使用它与axum-sessions
1条答案
按热度按时间gijlo24d1#
axum_database_session
的默认功能是["postgres-rustls"]
,因此如果你想使用*-native
,你必须禁用默认功能:但是由于你在
sqlx
的依赖项中显式地包含了rustls
,你可能只想使用mysql-rustls
,仍然没有默认功能,因为你使用的是MySQL而不是PostgreSQL: