Lines Matching +full:exact +full:- +full:len

1 // SPDX-License-Identifier: Apache-2.0 OR MIT
46 …pub(super) end: *const T, // If T is a ZST, this is actually ptr+len. This encoding is picked so t…
48 // for both ZST and non-ZST.
53 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt()
71 pub fn as_slice(&self) -> &[T] { in as_slice()
72 unsafe { slice::from_raw_parts(self.ptr, self.len()) } in as_slice()
89 pub fn as_mut_slice(&mut self) -> &mut [T] { in as_mut_slice()
96 pub fn allocator(&self) -> &A { in allocator()
100 fn as_raw_mut_slice(&mut self) -> *mut [T] { in as_raw_mut_slice()
101 ptr::slice_from_raw_parts_mut(self.ptr as *mut T, self.len()) in as_raw_mut_slice()
117 /// This method is used by in-place iteration, refer to the vec::in_place_collect
147 pub(crate) fn into_vecdeque(self) -> VecDeque<T, A> { in into_vecdeque()
153 // so the `sub_ptr`s below cannot wrap, and will produce a well-formed in into_vecdeque()
154 // range. `end` ≤ `buf + cap`, so the range will be in-bounds. in into_vecdeque()
162 0..this.len() in into_vecdeque()
175 fn as_ref(&self) -> &[T] { in as_ref()
190 fn next(&mut self) -> Option<T> { in next()
209 fn size_hint(&self) -> (usize, Option<usize>) { in size_hint()
210 let exact = if T::IS_ZST { in size_hint() localVariable
215 (exact, Some(exact)) in size_hint()
219 fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize> { in advance_by()
220 let step_size = self.len().min(n); in advance_by()
233 NonZeroUsize::new(n - step_size).map_or(Ok(()), Err) in advance_by()
237 fn count(self) -> usize { in count()
238 self.len() in count()
242 fn next_chunk<const N: usize>(&mut self) -> Result<[T; N], core::array::IntoIter<T, N>> { in next_chunk()
245 let len = self.len(); localVariable
248 if len < N {
251 return Err(unsafe { array::IntoIter::new_unchecked(raw_ary, 0..len) });
259 if len < N {
260 … // Safety: `len` indicates that this many elements are available and we just checked that
263 ptr::copy_nonoverlapping(self.ptr, raw_ary.as_mut_ptr() as *mut T, len);
265 return Err(array::IntoIter::new_unchecked(raw_ary, 0..len));
269 // Safety: `len` is larger than the array size. Copy a fixed amount here to fully initialize
278 unsafe fn __iterator_get_unchecked(&mut self, i: usize) -> Self::Item in __iterator_get_unchecked()
299 fn next_back(&mut self) -> Option<T> { in next_back()
316 fn advance_back_by(&mut self, n: usize) -> Result<(), NonZeroUsize> { in advance_back_by()
317 let step_size = self.len().min(n); in advance_back_by()
330 NonZeroUsize::new(n - step_size).map_or(Ok(()), Err) in advance_back_by()
336 fn is_empty(&self) -> bool { in is_empty()
357 /// assert_eq!(iter.len(), 0);
360 fn default() -> Self { in default()
371 // and thus we can't implement drop-handling
390 fn clone(&self) -> Self { in clone()
394 fn clone(&self) -> Self { in clone()
436 unsafe fn as_inner(&mut self) -> &mut Self::Source { in as_inner()
445 fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item> { in as_into_iter()