Searched refs:len (Results 1 – 10 of 10) sorted by relevance
/rust/alloc/vec/ |
D | mod.rs | 404 len: usize, field 427 Vec { buf: RawVec::NEW, len: 0 } in new() 568 Vec { buf: RawVec::new_in(alloc), len: 0 } in new_in() 617 Vec { buf: RawVec::with_capacity_in(capacity, alloc), len: 0 } in with_capacity_in() 693 unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } } in from_raw_parts_in() 731 (me.as_mut_ptr(), me.len(), me.capacity()) in into_raw_parts() 775 let len = me.len(); in into_raw_parts_with_alloc() localVariable 779 (ptr, len, capacity, alloc) in into_raw_parts_with_alloc() 817 self.buf.reserve(self.len, additional); in reserve() 845 self.buf.reserve_exact(self.len, additional); in reserve_exact() [all …]
|
D | into_iter.rs | 67 unsafe { slice::from_raw_parts(self.ptr, self.len()) } in as_slice() 96 ptr::slice_from_raw_parts_mut(self.ptr as *mut T, self.len()) in as_raw_mut_slice() 183 let step_size = self.len().min(n); in advance_by() 206 self.len() in count() 248 let step_size = self.len().min(n); in advance_back_by()
|
D | drain.rs | 118 let start = source_vec.len(); in drop() 132 let drop_len = iter.len(); in drop() 141 let old_len = vec.len(); in drop()
|
/rust/alloc/ |
D | slice.rs | 169 let len = b.len(); in into_vec() localVariable 171 Vec::from_raw_parts_in(b as *mut T, len, len, alloc) in into_vec() 206 let mut vec = Vec::with_capacity_in(s.len(), alloc); in to_vec() 211 for (i, b) in s.iter().enumerate().take(slots.len()) { in to_vec() 219 vec.set_len(s.len()); in to_vec() 229 let mut v = Vec::with_capacity_in(s.len(), alloc); in to_vec() 234 s.as_ptr().copy_to_nonoverlapping(v.as_mut_ptr(), s.len()); in to_vec() 235 v.set_len(s.len()); in to_vec() 433 for i in 0..$slice.len() { in sort_by_cached_key() 449 let len = self.len(); in sort_by_cached_key() localVariable [all …]
|
D | raw_vec.rs | 156 pub unsafe fn into_box(self, len: usize) -> Box<[MaybeUninit<T>], A> { in into_box() 159 len <= self.capacity(), in into_box() 165 let slice = slice::from_raw_parts_mut(me.ptr() as *mut MaybeUninit<T>, len); in into_box() 276 pub fn reserve(&mut self, len: usize, additional: usize) { in reserve() 284 len: usize, in reserve() 287 handle_reserve(slf.grow_amortized(len, additional)); in reserve() 290 if self.needs_to_grow(len, additional) { in reserve() 291 do_reserve_and_handle(self, len, additional); in reserve() 299 pub fn reserve_for_push(&mut self, len: usize) { in reserve_for_push() 300 handle_reserve(self.grow_amortized(len, 1)); in reserve_for_push() [all …]
|
D | boxed.rs | 616 pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { in new_uninit_slice() 617 unsafe { RawVec::with_capacity(len).into_box(len) } in new_uninit_slice() 641 pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { in new_zeroed_slice() 642 unsafe { RawVec::with_capacity_zeroed(len).into_box(len) } in new_zeroed_slice() 667 pub fn try_new_uninit_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, AllocError> { in try_new_uninit_slice() 669 let layout = match Layout::array::<mem::MaybeUninit<T>>(len) { in try_new_uninit_slice() 674 Ok(RawVec::from_raw_parts_in(ptr.as_mut_ptr() as *mut _, len, Global).into_box(len)) in try_new_uninit_slice() 699 pub fn try_new_zeroed_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, AllocError> { in try_new_zeroed_slice() 701 let layout = match Layout::array::<mem::MaybeUninit<T>>(len) { in try_new_zeroed_slice() 706 Ok(RawVec::from_raw_parts_in(ptr.as_mut_ptr() as *mut _, len, Global).into_box(len)) in try_new_zeroed_slice() [all …]
|
D | borrow.rs | 474 let mut s = String::with_capacity(lhs.len() + rhs.len()); in add_assign() 491 let mut s = String::with_capacity(lhs.len() + rhs.len()); in add_assign()
|
/rust/kernel/ |
D | str.rs | 52 let pos_new = self.pos.saturating_add(s.len()); in write_str()
|
/rust/macros/ |
D | helpers.rs | 24 Some(byte_string[2..byte_string.len() - 1].to_string()) in try_byte_string()
|
D | module.rs | 52 length = string.len(), in emit_base()
|