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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
你在找“Rust 在线编程环境”?这里是最实用的选项与集成方式
链接:Rust Playground
链接:Replit Rust
链接:GitHub Codespaces
链接:Gitpod
链接:CodeSandbox
链接:Piston API
在你现有站点(Next.js)内集成的两种实操方案
方案 A(最省事)— 跳转/嵌入 Playground
用
encodeURIComponent把代码拼到https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&code=...即可一键打开。适合演示与分享。方案 B(可控且可扩展)— 执行 API + 前端编辑器
架构:前端编辑器(Monaco/CodeMirror) → 你的后端 API → 转发到执行服务(如 Piston)
示例后端(Next.js
app路由):前端直接
fetch('/api/run-rust')提交code与stdin,拿回stdout/stderr渲染即可。怎么选
需要我把“方案 B”直接接到你的这个仓库,并加一个可用的 Rust 运行页面吗?我可以一次性补齐后端路由、前端编辑器与基本 UI。
Beta Was this translation helpful? Give feedback.
All reactions