検索

phrase: max: clip:
target: order:
Results of 11 - 16 of about 16 for usize (0.028 sec.)
print.html 8075
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... しょう。 #![allow(unused)] fn main() { fn index(idx: usize, arr: &[u8]) -> Option<u8> { if idx < arr.len() { ... しょう。 #![allow(unused)] fn main() { fn index(idx: usize, arr: &[u8]) -> Option<u8> { if idx <= arr.len() { ... みてください。 pub struct Vec<T> { ptr: *mut T, len: usize, cap: usize, } // この実装ではサイズが 0 の型を正し ... derived from some parent scope fn foo(&'a str) -> usize; This signature claims that it can handle any &str ...
https://man.plustar.jp/rust/nomicon/print.html - [similar]
挿入と削除 7832
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ] にシフトします。 pub fn insert(&mut self, index: usize, elem: T) { // 注意: 全要素の後に挿入しても問題ない ... ] にシフトします。 pub fn remove(&mut self, index: usize) -> T { // 注意: 全要素のあとの物を削除することは* ...
https://man.plustar.jp/rust/nomicon/vec-insert-remove.html - [similar]
リーク 7503
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... RcBox<T>, } struct RcBox<T> { data: T, ref_count: usize, } impl<T> Rc<T> { fn new(data: T) -> Self { unsaf ... で微妙な前提を含んでいます。すなわち、 ref_count が usize に 収まるということです。なぜなら、 usize::MAX 個以 ...
https://man.plustar.jp/rust/nomicon/leaking.html - [similar]
アロケーティング 7174
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... る、 // `new_cap <= isize::MAX` と `new_num_bytes <= usize::MAX` を // 組み合わせています。もっとも、例えば 3 ... です) assert!(old_num_bytes <= (::std::isize::MAX as usize) / 2, "capacity overflow"); let new_num_bytes = ol ...
https://man.plustar.jp/rust/nomicon/vec-alloc.html - [similar]
チェックされないメモリ 7087
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... いう構文を使えないことを意味しますがね! const SIZE: usize = 10; let mut x: [Box<u32>; SIZE]; unsafe { // Rus ...
https://man.plustar.jp/rust/nomicon/unchecked-uninit.html - [similar]
借用の分割 7000
はじめに 1. 安全と危険のご紹介 1.1. 安全と危険の相互作用 1.2. Unsafe と連携する 2. データレイアウ ... ードを必要とします。 fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) { let len = self.len(); l ...
https://man.plustar.jp/rust/nomicon/borrow-splitting.html - [similar]
PREV 1 2 NEXT