• Home
  • Raw
  • Download

Lines Matching refs:len

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()
304 pub fn try_reserve(&mut self, len: usize, additional: usize) -> Result<(), TryReserveError> { in try_reserve()
305 if self.needs_to_grow(len, additional) { in try_reserve()
306 self.grow_amortized(len, additional) in try_reserve()
314 pub fn try_reserve_for_push(&mut self, len: usize) -> Result<(), TryReserveError> { in try_reserve_for_push()
315 self.grow_amortized(len, 1) in try_reserve_for_push()
336 pub fn reserve_exact(&mut self, len: usize, additional: usize) { in reserve_exact()
337 handle_reserve(self.try_reserve_exact(len, additional)); in reserve_exact()
343 len: usize, in try_reserve_exact()
346 if self.needs_to_grow(len, additional) { self.grow_exact(len, additional) } else { Ok(()) } in try_reserve_exact()
368 fn needs_to_grow(&self, len: usize, additional: usize) -> bool { in needs_to_grow()
369 additional > self.capacity().wrapping_sub(len) in needs_to_grow()
387 fn grow_amortized(&mut self, len: usize, additional: usize) -> Result<(), TryReserveError> { in grow_amortized()
398 let required_cap = len.checked_add(additional).ok_or(CapacityOverflow)?; in grow_amortized()
416 fn grow_exact(&mut self, len: usize, additional: usize) -> Result<(), TryReserveError> { in grow_exact()
423 let cap = len.checked_add(additional).ok_or(CapacityOverflow)?; in grow_exact()