Rust 程序设计语言 简体中文版 1.85.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 15.4. Rc引用计数智能指针 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 通常会指定捕获其环境的闭包作为迭代器适配器 的参数。 作为一个例子,我们使用 filter 方法来获取一个闭包。该闭包从迭代器中获取一项并返回一 个 bool。如果闭包返回 true,其值将会包含在 filter 提供的新迭代器中。如果闭包返回 false,其值不会被包含。 示例 13-16 中使用 filter 和一个捕获环境中变量 shoe_size 的闭包来遍历一个 Shoe 结构体 集合。它只会返回指定鞋码的鞋子。 String, } fn shoes_in_size(shoes: Vec , shoe_size: u32) -> Vec { shoes.into_iter().filter(|s| s.size == shoe_size).collect() } #[cfg(test)] mod tests { use super::*; #[test] 0 码力 | 562 页 | 3.23 MB | 8 天前3Tornado 6.5 Documentation
and returns a unicode string, but this may be overridden in subclasses. This method is used as a filter for both get_argument() and for values extracted from the url and passed to get()/post()/etc. The create_template_loader. • template_whitespace: Controls handling of whitespace in templates; see tornado.template. filter_whitespace for allowed values. New in Tornado 4.3. Static file settings: • static_hash_cache: Default next {% whitespace %} directive). 6.2. Web framework 65Tornado Documentation, Release 6.5.1 See filter_whitespace for available options. New in Tornado 4.3. Class reference class tornado.template.T0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
BaseLoader BaseLoader.reset() BaseLoader.resolve_path() BaseLoader.load() Loader DictLoader ParseError filter_whitespace() tornado.routing — Basic routing implementation Router Router.find_handler() ReversibleRouter and returns a unicode string, but this may be overridden in subclasses. This method is used as a filter for both get_argument() and for values extracted from the url and passed to get()/post()/etc. The create_template_loader. template_whitespace: Controls handling of whitespace in templates; see tornado.template.filter_whitespace for allowed values. New in Tornado 4.3. Static file settings: static_hash_cache: Default0 码力 | 437 页 | 405.14 KB | 2 月前3
共 3 条
- 1