検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 27 for pub (0.034 sec.)
トレイト:共通の振る舞いを定義する - Rust 日本語版 13890
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub trait Summary { fn summarize(&self) -> String; } } ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub trait Summary { fn summarize(&self) -> String; } p ... ub struct NewsArticle { pub headline: String, pub location: String, pub author ... : String, pub content: String, } impl Summary for NewsArticle { ...
https://man.plustar.jp/rust/book/ch10-02-traits.html - [similar]
モジュールツリーの要素を示すためのパス - Rust 日本語版 11948
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... _at_restaurant 関数はこのライブラリクレートの公開 (public) APIの1つなので、 pub キーワードをつけておきます ...pub については、 パスを pub キーワードで公開する の節で ... _house { mod hosting { fn add_to_waitlist() {} } } pub fn eat_at_restaurant() { // Absolute path // 絶対パ ... となく変更できるのかを知ることができます。 しかし、 pub キーワードを使って要素を公開することで、子モジュー ...
https://man.plustar.jp/rust/book/ch07-03-paths-for-referring-to-an-item-in-the-m... - [similar]
useキーワードでパスをスコープに持ち込む - Rust 日本語版 9957
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... います。 ファイル名: src/lib.rs mod front_of_house { pub mod hosting { pub fn add_to_waitlist() {} } } use ... crate::front_of_house::hosting; pub fn eat_at_restaurant() { hosting::add_to_waitlist( ... います。 ファイル名: src/lib.rs mod front_of_house { pub mod hosting { pub fn add_to_waitlist() {} } } use ... self::front_of_house::hosting; pub fn eat_at_restaurant() { hosting::add_to_waitlist( ...
https://man.plustar.jp/rust/book/ch07-04-bringing-paths-into-scope-with-the-use-... - [similar]
トレイトオブジェクトで異なる型の値を許容する - Rust 日本語版 9809
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub trait Draw { fn draw(&self); } } リスト17-3: Draw ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub trait Draw { fn draw(&self); } pub struct Screen { ... pub components: Vec<Box<Draw>>, } } リスト17-4: Draw ト ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub trait Draw { fn draw(&self); } pub struct Screen { ...
https://man.plustar.jp/rust/book/ch17-02-trait-objects.html - [similar]
オブジェクト指向デザインパターンを実装する - Rust 日本語版 9562
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub struct Post { state: Option<Box<State>>, content: ... String, } impl Post { pub fn new() -> Post { Post { state: Some(Box::new(Dra ... 有される振る舞いを定義し、 Draft 、 PendingReview 、 Published 状態は全て、 State トレイトを実装します。今は ... りたいことを示しました。 これを content フィールドを pub にして晒すのではなく、メソッドとして実装しています ...
https://man.plustar.jp/rust/book/ch17-03-oo-design-patterns.html - [similar]
Crates.ioにクレートを公開する - Rust 日本語版 9101
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... / /// assert_eq!(6, my_crate::add_one(5)); /// ``` pub fn add_one(x: i32) -> i32 { x + 1 } リスト14-1: 関 ... トの体系を理解する手助けをするのに使用してください。 pub use で便利な公開APIをエクスポートする 第7章において ... ワードを使用してモジュールにコードを体系化する方法、 pub キーワードで要素を公開にする方法、 use キーワードで ... いということです: 代わりに、要素を再エクスポートし、 pub use で自分の非公開構造とは異なる公開構造にできます ...
https://man.plustar.jp/rust/book/ch14-02-publishing-to-crates-io.html - [similar]
シングルスレッドサーバをマルチスレッド化する - Rust 日本語版 9101
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub struct ThreadPool; } それから新しいディレクトリ、 ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub struct ThreadPool; impl ThreadPool { pub fn new(si ... 告: 未使用の変数: `size`) --> src/lib.rs:4:16 | 4 | pub fn new(size: usize) -> ThreadPool { | ^^^^ | = not ... 。ドキュメンテーションは、以下のものを示しています: pub fn spawn<F, T>(f: F) -> JoinHandle<T> where F: FnO ...
https://man.plustar.jp/rust/book/ch20-02-multithreaded.html - [similar]
モジュールを複数のファイルに分割する - Rust 日本語版 8788
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... きます。 ファイル名: src/lib.rs mod front_of_house; pub use crate::front_of_house::hosting; pub fn eat_at_ ... の定義を与えます。 ファイル名: src/front_of_house.rs pub mod hosting { pub fn add_to_waitlist() {} } Listin ... ように変更します: ファイル名: src/front_of_house.rs pub mod hosting; さらに src/front_of_house ディレクトリ ... _of_house/hosting.rs #![allow(unused)] fn main() { pub fn add_to_waitlist() {} } 定義は別のファイルにある ...
https://man.plustar.jp/rust/book/ch07-05-separating-modules-into-different-files... - [similar]
環境変数を取り扱う - Rust 日本語版 8278
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub fn search_case_insensitive<'a>(query: &str, conten ... ファイル名: src/lib.rs #![allow(unused)] fn main() { pub struct Config { pub query: String, pub filename: S ... tring, pub case_sensitive: bool, } } 論理値を持つ case_sensit ... str, contents: &'a str) -> Vec<&'a str> { vec![] } pub fn search_case_insensitive<'a>(query: &str, conten ...
https://man.plustar.jp/rust/book/ch12-05-working-with-environment-variables.html - [similar]
テストの記述法 - Rust 日本語版 8179
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... この関数をテストしています。 ファイル名: src/lib.rs pub fn add_two(a: i32) -> i32 { a + 2 } #[cfg(test)] m ... 関数の実装を代わりに 3 を足すように変えてください: pub fn add_two(a: i32) -> i32 { a + 3 } #[cfg(test)] m ... とをテストしたいとしましょう: ファイル名: src/lib.rs pub fn greeting(name: &str) -> String { format!("Hello ... このテストの失敗がどんな風になるのか確かめましょう: pub fn greeting(name: &str) -> String { String::from(" ...
https://man.plustar.jp/rust/book/ch11-01-writing-tests.html - [similar]
PREV 1 2 3 NEXT