灵活的请求响应
-
- Actix中的Handler函数可以返回实现该Respondert
rait的各种对象。这使得从API返回一致的响应变得轻而易举。
-
diff --git a/config.toml b/config.toml index 154dd23..e574e1c 100644 --- a/config.toml +++ b/config.toml @@ -3,20 +3,19 @@ canonifyURLs = true googleAnalytics = "UA-110322332-1" pygmentsUseClasses = true pygmentsCodeFences = true - -defaultContentLanguageInSubdir = true +defaultContentLanguageInSubdir = false enableRobotsTXT = true - +enableMissingTranslationPlaceholders = true DefaultContentLanguage = "en" +baseURL = "https://actix.rs" -[languages] [languages.en] - baseURL = "https://actix.rs" - languageCode = "en-us" + languageCode = "en-US" + languageName = "English" weight = 1 [languages.cn] - baseURL = "https://actix.rs/cn" - languageCode = "zh-cn" + languageCode = "zh-CN" + languageName = "中文" weight = 2 [params] diff --git a/i18n/cn.toml b/i18n/cn.toml new file mode 100644 index 0000000..86f2acf --- /dev/null +++ b/i18n/cn.toml @@ -0,0 +1,8 @@ +[home] +other = "首页" +[docs] +other = "文档" +[community] +other = "社区" +[code] +other = "源码" diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..9fddc1f --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,8 @@ +[home] +other = "Home" +[docs] +other = "Documentation" +[community] +other = "Community" +[code] +other = "Code" diff --git a/layouts/index.cn.html b/layouts/index.cn.html new file mode 100644 index 0000000..bb5e631 --- /dev/null +++ b/layouts/index.cn.html @@ -0,0 +1,149 @@ +{{ partial "header" . }} + +
Rust强大的actor系统和有趣的web框架
+忘记关于字符串类型的对象,从请求到响应,一切都有类型,异步。
+ +Actix提供了丰富的特性开箱即用。WebSockets,HTTP/2,流,管道,SSL,异步HTTTP客户端等一应俱全.
+ +轻松创建任何基于Actix应用的自己的特色库。
+ +Actix 具有顶级的速度. Check yourself.
+
+ Actix中的Handler函数可以返回实现该Respondert
rait的各种对象。这使得从API返回一致的响应变得轻而易举。
+
+ Actix提供了一个强大的提取器系统,可以从传入的HTTP请求中提取数据并将其传递给您的视图函数。这不仅可以创建方便的API, + 而且还意味着您的视图函数可以是同步代码,并且仍然可以受益于异步IO处理。 +
+ {{ highlight `#[derive(Deserialize)] +struct Event { + timestamp: f64, + kind: String, + tags: Vec+ 处理multipart/ urlencoded表单数据很容易。只需定义一个可以反序列化的结构,actix就可以处理剩下的部分。 +
+ {{ highlight `#[derive(Deserialize)] +struct Register { + username: String, + country: String, +} + +fn register(data: Form+ 一个actix应用程序带有一个URL路由系统,可以让你在URL上匹配并调用单个处理程序。为了获得额外的灵活性,可以使用域。 +
+ {{ highlight `fn index(req: HttpRequest) -> impl Responder { + "Hello from the index page" +} + +fn hello(path: PathActix is blazingly fast. Check yourself.
+Actix is blazingly fast. See for yourself.
Rust强大的actor系统和有趣的web框架
-忘记关于字符串类型的对象,从请求到响应,一切都有类型,异步。
- -Actix提供了丰富的特性开箱即用。WebSockets,HTTP/2,流,管道,SSL,异步HTTTP客户端等一应俱全.
- -轻松创建任何基于Actix应用的自己的特色库。
- -Actix 具有顶级的速度. Check yourself.
-
- Actix中的Handler函数可以返回实现该Respondert
rait的各种对象。这使得从API返回一致的响应变得轻而易举。
-