Compare commits

...

2 Commits

Author SHA1 Message Date
9a716af400
ruaaaa 2024-01-24 14:41:08 +08:00
053d126b62
写点 pyo3 2024-01-24 14:29:31 +08:00
4 changed files with 36 additions and 0 deletions

11
ica-rs/Cargo.lock generated
View File

@ -154,6 +154,16 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "colored"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8"
dependencies = [
"lazy_static",
"windows-sys 0.48.0",
]
[[package]]
name = "const-oid"
version = "0.9.5"
@ -540,6 +550,7 @@ dependencies = [
name = "ica-rs"
version = "0.1.0"
dependencies = [
"colored",
"ed25519",
"ed25519-dalek",
"hex",

View File

@ -2,6 +2,7 @@
name = "ica-rs"
version = "0.1.0"
edition = "2021"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -12,6 +13,10 @@ hex = "0.4.3"
rust_socketio = "0.4.4"
serde_json = "1.0.108"
toml = "0.8.8"
colored = "2.1.0"
[patch.crates-io]
rust_socketio = { path = "../../../rust-socketio/socketio" }
[build-dependencies]

19
ica-rs/build.rs Normal file
View File

@ -0,0 +1,19 @@
use std::env;
// 指定 pyo3 的绑定对象
fn pyo3_config() {
// PYO3_PYTHON=xxxx
#[cfg(windows)]
{
env::set_var("PYO3_PYTHON", "python3.10")
}
// wsl
#[cfg(target_os = "linux")]
{
env::set_var("PYO3_PYTHON", "python3.10")
}
}
fn main() {
pyo3_config();
}

View File

@ -1,5 +1,6 @@
mod client;
use colored::*;
use ed25519_dalek::{Signature, Signer, SigningKey};
use rust_socketio::{ClientBuilder, Event, Payload, RawClient};
use serde_json::Value;