検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 23 for static (0.023 sec.)
スタティックライフタイム - Rust By Example 日本語版 15617
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... つかの予約されたライフタイム名があります。その1つが static で、2つの状況で使用することがあります。 // A refer ... ence with 'static lifetime: let s: &'static str = "hello world"; // ... 'static as part of a trait bound: fn generic<T>(x: T) wher ... e T: 'static {} Both are related but subtly different and this ...
https://man.plustar.jp/rust/example/scope/lifetime/static_lifetime.html - [similar]
ミュータビリティ - Rust By Example 日本語版 9685
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... _code)] #[derive(Clone, Copy)] struct Book { // `&'static str` is a reference to a string allocated in read ... only memory // `&'static str`はread-onlyメモリ上の文字列への参照 author: &' ... static str, title: &'static str, year: u32, } // This function takes a referen ... mmutabook = Book { // string literals have type `&'static str` // 「"」で囲まれた部分は`&'static str`型になる ...
https://man.plustar.jp/rust/example/scope/borrow/mut.html - [similar]
トレイト - Rust By Example 日本語版 9685
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 可能になります。 struct Sheep { naked: bool, name: &'static str } trait Animal { // Associated function signat ... このトレイトを実装している型になる。 fn new(name: &'static str) -> Self; // Method signatures; these will ret ... / これらの関数は文字列を返す。 fn name(&self) -> &'static str; fn noise(&self) -> &'static str; // Traits ca ... elf`は実装対象の型: ここでは`Sheep` fn new(name: &'static str) -> Sheep { Sheep { name: name, naked: false } ...
https://man.plustar.jp/rust/example/trait.html - [similar]
定数 - Rust By Example 日本語版 9568
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ません。 const : 不変の値(通常はこちらを使用する) static : スタティックな ライフタイムを持つミュータブル( m ... ut )な値 The static lifetime is inferred and does not have to be speci ... fied. Accessing or modifying a mutable static variable is unsafe . // Globals are declared outsi ... / グローバル変数はあらゆるスコープの外で宣言します static LANGUAGE: &str = "Rust"; const THRESHOLD: i32 = 10 ...
https://man.plustar.jp/rust/example/custom_types/constants.html - [similar]
Returning Traits with dyn - Rust By Example 日本語版 8311
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... some memory in the heap. Because a reference has a statically-known size, and the compiler can guarantee it ... // Instance method signature fn noise(&self) -> &'static str; } // Implement the `Animal` trait for `Sheep` ... . impl Animal for Sheep { fn noise(&self) -> &'static str { "baaaaah!" } } // Implement the `Animal` tra ... `Cow`. impl Animal for Cow { fn noise(&self) -> &'static str { "moooooo!" } } // Returns some struct that i ...
https://man.plustar.jp/rust/example/trait/dyn.html - [similar]
Rust By Example 日本語版 8060
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... :{self, Formatter, Display}; struct City { name: &'static str, // Latitude // 緯度 lat: f32, // Longitude // ... を定義する enum : 列挙型を定義する const 、あるいは static というキーワードによって定数を定義することもできま ... ません。 const : 不変の値(通常はこちらを使用する) static : スタティックな ライフタイムを持つミュータブル( m ... ut )な値 The static lifetime is inferred and does not have to be speci ...
https://man.plustar.jp/rust/example/print.html - [similar]
テストケース: 空トレイト - Rust By Example 日本語版 8009
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... か否かとは関係がない。 fn red<T: Red>(_: &T) -> &'static str { "red" } fn blue<T: Blue>(_: &T) -> &'static ...
https://man.plustar.jp/rust/example/generics/bounds/testcase_empty.html - [similar]
Path - Rust By Example 日本語版 8009
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... h::Path; fn main() { // Create a `Path` from an `&'static str` // `&'static str`から`Path`を作成 let path = ...
https://man.plustar.jp/rust/example/std_misc/path.html - [similar]
パイプ - Rust By Example 日本語版 7942
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... o::prelude::*; use std::process::{Command, Stdio}; static PANGRAM: &'static str = "the quick brown fox jumpe ...
https://man.plustar.jp/rust/example/std_misc/process/pipe.html - [similar]
明示的アノテーション - Rust By Example 日本語版 7892
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... he lifetime is never constrained, it defaults to `'static`. // `failed_borrow`は関数のライフタイムよりも`'a` ... なる。なぜならそのような // 場合`'a`はデフォルトで`'static`になるからである。 } 1 省略 はライフタイムが暗黙の ...
https://man.plustar.jp/rust/example/scope/lifetime/explicit.html - [similar]
PREV 1 2 3 NEXT