検索
Results of 1 - 9 of about 9 for Unique (0.003 sec.)
- レイアウト 13481
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...ョンに対する生ポインタを持つ場合、 *mut T の代わりに Unique<T> を使用するべきです。 Unique はアンステーブルなた...め、 可能なら使いませんが。 繰り返しになりますが、 Unique は生ポインタのラッパで、以下のことを宣言 します。...tomData; use std::ops::Deref; use std::mem; struct Unique<T> { ptr: *const T, // 変性のために *const です _m...を継承することは安全です。なぜならこのデータの // Unique を所有しているからです。 Unique<T> は "単なる" T の... - https://man.plustar.jp/rust/nomicon/vec-layout.html - [similar]
- デストラクタ 10479
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...を書くかもしれません。 #![feature(alloc, heap_api, unique)] extern crate alloc; use std::ptr::{drop_in_place..., Unique}; use std::mem; use alloc::heap; struct Box<T>{ pt...r: Unique<T> } impl<T> Drop for Box<T> { fn drop(&mut self)...ルドをドロップする際、単に、実際の Drop 実装が ない Unique に着目するため、このコードは問題なく動くのです。 同... - https://man.plustar.jp/rust/nomicon/destructors.html - [similar]
- Final Code 9005
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...ault) Rust Coal Navy Ayu The Final Code #![feature(unique)] #![feature(alloc, heap_api)] extern crate alloc;...use std::ptr::{Unique, self}; use std::mem; use std::ops::{Deref, DerefM...ntomData; use alloc::heap; struct RawVec<T> { ptr: Unique<T>, cap: usize, } impl<T> RawVec<T> { fn new() ->...located" and "zero-sized allocation" RawVec { ptr: Unique::new(heap::EMPTY as *mut T), cap: cap } } } fn gro... - https://man.plustar.jp/rust/nomicon/vec-final.html - [similar]
- RawVec 8574
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...解放のロジックを 与えます。 struct RawVec<T> { ptr: Unique<T>, cap: usize, } impl<T> RawVec<T> { fn new() ->...O: implement ZST support"); unsafe { RawVec { ptr: Unique::new(heap::EMPTY as *mut T), cap: 0 } } } // Vec の...が返ってきます if ptr.is_null() { oom() } self.ptr = Unique::new(ptr as *mut _); self.cap = new_cap; } } } imp... - https://man.plustar.jp/rust/nomicon/vec-raw.html - [similar]
- アロケーティング 8070
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...fault) Rust Coal Navy Ayu メモリのアロケーティング Unique を使用することで、 Vec の重要な機能に関して (そして...があります。 // 推論してもらいましょう。 Vec { ptr: Unique::new(heap::EMPTY as *mut _), len: 0, cap: 0 } } }...返ってきます if ptr.is_null() { oom(); } self.ptr = Unique::new(ptr as *mut _); self.cap = new_cap; } } ここで... - https://man.plustar.jp/rust/nomicon/vec-alloc.html - [similar]
- サイズが 0 の型を扱う 8016
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
.../ 2 つの意味を兼ねることになります。 RawVec { ptr: Unique::new(heap::EMPTY as *mut T), cap: cap } } } fn gro...が返ってきます if ptr.is_null() { oom() } self.ptr = Unique::new(ptr as *mut _); self.cap = new_cap; } } } imp... - https://man.plustar.jp/rust/nomicon/vec-zsts.html - [similar]
- PhantomData 7891
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...standard library made a utility for itself called Unique<T> which: wraps a *const T for variance includes a... - https://man.plustar.jp/rust/nomicon/phantom-data.html - [similar]
- IntoIter 7765
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...な構造体を使っていきます。 struct IntoIter<T> { buf: Unique<T>, cap: usize, start: *const T, end: *const T, }... - https://man.plustar.jp/rust/nomicon/vec-into-iter.html - [similar]
- print.html 7531
- はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ
...standard library made a utility for itself called Unique<T> which: wraps a *const T for variance includes a... - https://man.plustar.jp/rust/nomicon/print.html - [similar]
PREV
1
NEXT