知识卡片
框架可从应用推导设施
Shuttle 展示了一种以应用代码表达基础设施需求的方式。书里的例子用 #[shuttle_runtime::main] 标注入口并返回 axum 路由,框架据此部署 Web 端点和支撑它的设施。
显式资源 DSL 需要调用者列出桶、函数等资源。Shuttle 的入口让调用者表达应用的行为,由框架处理所需环境,两者所处的抽象层次不同。
相关卡片 [[基础设施配置即代码]]、[[声明如何变成云资源]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Writing an infrastructure DSL 实际项目如何组合宏 · 查看原书依据
Shuttle was also mentioned in several places as an example of IaC, which takes the concept one step further. You write your code, and Shuttle takes care of the infrastructure that you need, without you explicitly defining what that is.
参考来源
- 位置:《Write Powerful Rust Macros》第09章《Writing an infrastructure DSL》(book-source:extracted/Write Powerful Rust Macros/_epub-src/OEBPS/Text/chapter-9.xhtml#p165)
- 结论依据:原书将 Shuttle 作为进一步抽象的 IaC 示例,并演示只提供应用路由和入口时的部署效果。
- 原始内容:Shuttle was also mentioned in several places as an example of IaC, which takes the concept one step further. You write your code, and Shuttle takes care of the infrastructure that you need, without you explicitly defining what that is.