You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::io::Result;use submillisecond::extract::Path;use submillisecond::{router,Application,NamedParam};fnmain() -> Result<()>{Application::new(router!{GET"/" => index
GET"/:name" => hi
GET"/:name/:age" => hi_2
GET"/users/:first/:last/:age" => greet
}).serve("0.0.0.0:3000")}fnindex() -> &'static str{"Hello :)"}#[derive(NamedParam)]#[param(name = "name")]structHiParams(String);fnhi(HiParams(name):HiParams) -> String{format!("Hi {}!", name)}fnhi_2(Path((name, age)):Path<(String,String)>) -> String{format!("Hi {}({})!", name, age)}#[derive(NamedParam)]structGreetInfo{first:String,last:String,age:u32,}fngreet(GreetInfo{ first, last, age }:GreetInfo) -> String{format!("Welcome {first} {last}. You are {age} years old.")}
http://localhost:3000/users/1/2/3 => Welcome 1 2. You are 1 years old.
http://localhost:3000/1/2/
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /Users/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/submillisecond-0.4.1/src/extract/path.rs:156:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2023-09-19T19:52:41Z WARN lunatic_process] Process 14 failed, notifying: 1 links
(Set ENV variable `RUST_LOG=lunatic=debug` to show stacktrace)
INFO submillisecond::supervisor: GET /1/2/ -
ERROR submillisecond::supervisor: Worker process panicked
It's also not possible to create NamedParam with only one param.
The configuration in the Cargo.toml also don't work. When running cargo build --target=wasm32-wasi everything works fine.
[package]
name = "playground"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "playground"path = "src/lib.rs"
[build]
target = "wasm32-wasi"
[target.wasm32-wasi]
runner = "lunatic"
[dependencies]
submillisecond = "0.4.1"submillisecond-live-view = "0.4.1"serde = "1.0.188"serde_json = "1.0.107"
But cargo build fails.
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered:
@bkolobara were you ever able to look into this? I'm still running into this problem with Structs with a non String Type included and all Tuples provided to Path
http://localhost:3000/users/1/2/3
=>Welcome 1 2. You are 1 years old.
http://localhost:3000/1/2/
It's also not possible to create
NamedParam
with only one param.The configuration in the
Cargo.toml
also don't work. When runningcargo build --target=wasm32-wasi
everything works fine.But
cargo build
fails.The text was updated successfully, but these errors were encountered: