検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 13 for data (0.022 sec.)
ライフタイム 11577
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... それでは、以前に出した例を見てみましょう。 fn as_str(data: &u32) -> &str { let s = format!("{}", data); &s } ... は次のように脱糖されます。 fn as_str<'a>(data: &'a u32) -> &'a str { 'b: { let s = format!("{}", ... data); return &'a s; } } as_str のシグネチャは、 ある ラ ...
https://man.plustar.jp/rust/nomicon/lifetimes.html - [similar]
Atomics 10962
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... all sorts of complicated transformations to reduce data dependencies and eliminate dead code. In particula ... CPU would rather work with its local cache of the data and only go through all the anguish of talking to ... ithms should be tested on weakly-ordered hardware. Data Accesses The C11 memory model attempts to bridge t ...
https://man.plustar.jp/rust/nomicon/atomics.html - [similar]
高階トレイト境界 10715
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... 、次のように書くことができます。 struct Closure<F> { data: (u8, u16), func: F, } impl<F> Closure<F> where F: ... > &u8, { fn call(&self) -> &u8 { (self.func)(&self.data) } } fn do_it(data: &(u8, u16)) -> &u8 { &data.0 } ... fn main() { let clo = Closure { data: (0, 1), func: do_it }; println!("{}", clo.call()) ...
https://man.plustar.jp/rust/nomicon/hrtb.html - [similar]
print.html 10170
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... nused)] fn main() { struct Foo<T, U> { count: u16, data1: T, data2: U, } } さて、単体化した Foo<u32, u16> ... ると思われます。 struct Foo<u16, u32> { count: u16, data1: u16, data2: u32, } struct Foo<u32, u16> { count: ... u16, _pad1: u16, data1: u32, data2: u16, _pad2: u16, } 後者の例ははっきり ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
Drop Check 9853
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... some Drop implementations will not access borrowed data even though their type gives them the capability f ... above Inspector example will never access borrowed data: struct Inspector<'a>(&'a u8, &'static str); impl< ... wise, this variant will also never access borrowed data: use std::fmt; struct Inspector<T: fmt::Display>(T ...
https://man.plustar.jp/rust/nomicon/dropck.html - [similar]
リーク 8938
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... ct Rc<T> { ptr: *mut RcBox<T>, } struct RcBox<T> { data: T, ref_count: usize, } impl<T> Rc<T> { fn new(dat ... p::allocate::<RcBox<T>>(); ptr::write(ptr, RcBox { data: data, ref_count: 1, }); Rc { ptr: ptr } } } fn cl ... を所有するか、データは Sync ということになります ( &data が Send であることを示唆します) 。 JoinGuard がライ ...
https://man.plustar.jp/rust/nomicon/leaking.html - [similar]
所有権とライフタイム 8938
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... まった、この単純な間違いを見てみましょう。 fn as_str(data: &u32) -> &str { // 文字列を生成する let s = forma ... t!("{}", data); // しまった! この関数内でしか存在しないオブジェク ... らです。 例えばこのコードを見てみましょう。 let mut data = vec![1, 2, 3]; // 内部データの参照を取る let x = ...
https://man.plustar.jp/rust/nomicon/ownership.html - [similar]
例外安全性 8868
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... され、状態を綺麗にします。 struct Hole<'a, T: 'a> { data: &'a mut [T], /// `elt` は new で生成されたときから ... T>, pos: usize, } impl<'a, T> Hole<'a, T> { fn new(data: &'a mut [T], pos: usize) -> Self { unsafe { let e ... lt = ptr::read(&data[pos]); Hole { data: data, elt: Some(elt), pos: pos ...
https://man.plustar.jp/rust/nomicon/exception-safety.html - [similar]
競合 8076
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... ::{AtomicUsize, Ordering}; use std::sync::Arc; let data = vec![1, 2, 3, 4]; // Arc にすることで、 他のスレ ... に依存するため、競合状態となります。 println!("{}", data[idx.load(Ordering::SeqCst)]); } #![allow(unused)] ... ::{AtomicUsize, Ordering}; use std::sync::Arc; let data = vec![1, 2, 3, 4]; let idx = Arc::new(AtomicUsize ...
https://man.plustar.jp/rust/nomicon/races.html - [similar]
PhantomData 6967
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... Subtyping and Variance 3.8. Drop Check 3.9. PhantomData 3.10. 借用の分割 4. 型変換 4.1. 型強制 4.2. ドット ... x の実装 Light (default) Rust Coal Navy Ayu PhantomData When working with unsafe code, we can often end up ... ariance and drop checking. We do this using PhantomData , which is a special marker type. PhantomData cons ... 'a T s, so this is exactly what we tell the PhantomData to simulate: use std::marker; struct Iter<'a, T: ' ...
https://man.plustar.jp/rust/nomicon/phantom-data.html - [similar]
PREV 1 2 NEXT