Tornado 6.5 Documentation
required for functions using async def (otherwise the coroutine runner will not start). Finally, at the top level of a program, if the IOLoop is not yet running, you can start the IOLoop, run the coroutine, json_encode in the context of a JavaScript string literal (including template strings), only in the top-level syntactic context. The automatic escaping behavior can be disabled globally by passing autoescape=None Non-blocking HTTP client with no external dependencies. This class implements an HTTP 1.1 client on top of Tornado’s IOStreams. Some features found in the curl-based AsyncHTTPClient are not yet supported0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
required for functions using async def (otherwise the coroutine runner will not start).Finally, at the top level of a program, if the IOLoop is not yet running, you can start the IOLoop, run the coroutine, json_encode in the context of a JavaScript string literal (including template strings), only in the top-level syntactic context. The automatic escaping behavior can be disabled globally by passing autoescape=None Non-blocking HTTP client with no external dependencies. This class implements an HTTP 1.1 client on top of Tornado’s IOStreams. Some features found in the curl-based AsyncHTTPClient are not yet supported0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
push_str 方法来附加字符串 slice,从而使 String 变长,如示例 8-15 所示。 let mut s = String::from("foo"); s.push_str("bar"); 示例 8-15:使用 push_str 方法向 String 附加字符串 slice 执行这两行代码之后,s 将会包含 foobar。push_str 方法采用字符串 slice,因为我们并不需 要获取参数的所有权。例如,示例 8-16 中我们希望在将 s2 的内容附加到 s1 之后还能使用 它。 let mut s1 = String::from("foo"); let s2 = "bar"; s1.push_str(s2); println!("s2 is {s2}"); 示例 8-16:将字符串 slice 的内容附加到 String 后使用它 159/562Rust type。这个名字描述了它的作用:在函数从不返回的时候充当返回值。 下面是一个示例: fn bar() -> ! { // --snip-- } 这段代码可以读作 “函数 bar 从不返回”,而从不返回的函数被称为 发散函数(diverging functions)。不能创建 ! 类型的值,所以 bar 也不可能返回值。 不过一个不能创建值的类型有什么用呢?回想一下示例 2-5 中猜数字游戏的代码;我们在示例0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1