検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 11 for Foo (0.025 sec.)
ライフタイムシステムの限界 13371
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ムシステムの限界 次のコードを見てみましょう。 struct Foo; impl Foo { fn mutate_and_share(&mut self) -> &Sel ... &*self } fn share(&self) {} } fn main() { let mut foo = Foo; let loan = foo.mutate_and_share(); foo.shar ... ルを通ると思うかもしれません。 mutate_and_share は、 foo を一時的に変更可能に借用しますが、 共有参照を返しま ... す。 そうすると、 foo は変更可能には借用されていないので、 foo.share() は ...
https://man.plustar.jp/rust/nomicon/lifetime-mismatch.html - [similar]
print.html 10829
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... てみましょう。 #![allow(unused)] fn main() { struct Foo<T, U> { count: u16, data1: T, data2: U, } } さて、 ... 単体化した Foo<u32, u16> と Foo<u16, u32> とを考えてみます。 もし ... すると、次のような型を生成すると思われます。 struct Foo<u16, u32> { count: u16, data1: u16, data2: u32, } ... struct Foo<u32, u16> { count: u16, _pad1: u16, data1: u32, da ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
型強制 9815
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 効にします。 [T; n] => [T] T => Trait 但し T: Trait Foo<..., T, ...> => Foo<..., U, ...> 但し T: Unsize<U> ... Foo は構造体 Foo の最後のフィールドだけが T を含む型で ... ルドの一部となっていない Bar<T>: Unsize<Bar<U>> 但し Foo の最後のフィールドが Bar<T> の型である場合 型強制は ... 関数に対する引数: takes_a_U(e) 返される全ての式: fn foo() -> U { e } 構造体リテラル: Foo { some_u: e } 配列 ...
https://man.plustar.jp/rust/nomicon/coercions.html - [similar]
型変換 8890
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... する方法です。 #![allow(unused)] fn main() { struct Foo { x: u32, y: u16, } struct Bar { a: u32, b: u16, } ... fn reinterpret(foo: Foo) -> Bar { let Foo { x, y } = foo; Bar { a: x, ... キーワード: 方法 , ビット , ライフタイム , メモリ , Foo , 提供 , 実装 , チェック , サイズ , struct ...
https://man.plustar.jp/rust/nomicon/conversions.html - [similar]
Subtyping and Variance 8890
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... nature: // 'a is derived from some parent scope fn foo(&'a str) -> usize; This signature claims that it c ... ture was variant over &'a str , that would mean fn foo(&'static str) -> usize; could be provided in its p ... nature: // 'a is derived from some parent scope fn foo(usize) -> &'a str; This signature claims that it w ... t is therefore completely reasonable to provide fn foo(usize) -> &'static str; in its place. Therefore fu ...
https://man.plustar.jp/rust/nomicon/subtyping.html - [similar]
repr(Rust) 8375
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... てみましょう。 #![allow(unused)] fn main() { struct Foo<T, U> { count: u16, data1: T, data2: U, } } さて、 ... 単体化した Foo<u32, u16> と Foo<u16, u32> とを考えてみます。 もし ... すると、次のような型を生成すると思われます。 struct Foo<u16, u32> { count: u16, data1: u16, data2: u32, } ... struct Foo<u32, u16> { count: u16, _pad1: u16, data1: u32, da ...
https://man.plustar.jp/rust/nomicon/repr-rust.html - [similar]
奇妙なサイズの型 7788
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... fn main() { // 直接スタックには置けません。 struct Foo { info: u32, data: [u8], } } Rust 1.0 時点では、最 ... とができます。 #![allow(unused)] fn main() { struct Foo; // フィールドがない = サイズ 0 // すべてのフィール ... ドのサイズがない = サイズ 0 struct Baz { foo: Foo, qux: (), // 空のタプルにはサイズがありません ...
https://man.plustar.jp/rust/nomicon/exotic-sizes.html - [similar]
コンストラクタ 7735
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... することです。 #![allow(unused)] fn main() { struct Foo { a: u8, b: u32, c: bool, } enum Bar { X(u32), Y(b ... ool), } struct Unit; let foo = Foo { a: 0, b: 1, c: false }; let bar = Bar::X(0 ...
https://man.plustar.jp/rust/nomicon/constructors.html - [similar]
プッシュとポップ 7486
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ンスとして評価してしまうからです。もっと悪いことに、 foo[idx] = x によって、 foo[idx] の古い値に対して drop ...
https://man.plustar.jp/rust/nomicon/vec-push-pop.html - [similar]
借用の分割 7308
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... 日動作します。 #![allow(unused)] fn main() { struct Foo { a: i32, b: i32, c: i32, } let mut x = Foo {a: 0, ...
https://man.plustar.jp/rust/nomicon/borrow-splitting.html - [similar]
PREV 1 2 NEXT