Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在动作/函数中找到当前 URL?我在文档中没有找到与此相关的任何内容。
Iron 主页有这个“hello world”示例:
fn hello_world(_: &mut Request) -> IronResult<Response> { Ok(Response::with((status::Ok, "Hello World!"))) }
该函数的唯一输入是 a Request。该结构的第一个字段是Url:
Request
Url
url:Url 请求的 URL。
url:Url
url
请求的 URL。