Lines Matching full:vec
3 //! Implementation of [`Vec`].
61 /// The kernel's [`Vec`] type.
64 /// [`Kmalloc`], [`Vmalloc`] or [`KVmalloc`]), written `Vec<T, A>`.
66 /// For non-zero-sized values, a [`Vec`] will use the given allocator `A` for its allocation. For
69 /// For zero-sized types the [`Vec`]'s pointer must be `dangling_mut::<T>`; no memory is allocated.
71 /// Generally, [`Vec`] consists of a pointer that represents the vector's backing buffer, the
76 /// A [`Vec`] can be deconstructed into and (re-)constructed from its previously named raw parts
79 /// [`Vec`]'s backing buffer gets, if required, automatically increased (re-allocated) when elements
95 pub struct Vec<T, A: Allocator> { struct
106 /// Type alias for [`Vec`] with a [`Kmalloc`] allocator. argument
117 pub type KVec<T> = Vec<T, Kmalloc>;
119 /// Type alias for [`Vec`] with a [`Vmalloc`] allocator.
130 pub type VVec<T> = Vec<T, Vmalloc>;
132 /// Type alias for [`Vec`] with a [`KVmalloc`] allocator.
143 pub type KVVec<T> = Vec<T, KVmalloc>;
145 // SAFETY: `Vec` is `Send` if `T` is `Send` because `Vec` owns its elements.
146 unsafe impl<T, A> Send for Vec<T, A> implementation
153 // SAFETY: `Vec` is `Sync` if `T` is `Sync` because `Vec` owns its elements.
154 unsafe impl<T, A> Sync for Vec<T, A> implementation
161 impl<T, A> Vec<T, A> implementation
241 /// Creates a new, empty `Vec<T, A>`.
246 // INVARIANT: Since this is a new, empty `Vec` with no backing memory yet, in new()
272 /// Appends an element to the back of the [`Vec`] instance.
305 /// Creates a new [`Vec`] instance with at least the given capacity.
316 let mut v = Vec::new(); in with_capacity()
323 /// Creates a `Vec<T, A>` from a pointer, a length and a capacity using the allocator `A`.
362 /// It is also valid to create an empty `Vec` passing a dangling pointer for `ptr` and zero for
385 /// Consumes the `Vec<T, A>` and returns its raw components `pointer`, `length` and `capacity`.
388 /// will stay alive indefinitely. Use [`Vec::from_raw_parts`] to recover the [`Vec`], drop the
457 impl<T: Clone, A: Allocator> Vec<T, A> { impl
483 /// Pushes clones of the elements of slice into the [`Vec`] instance.
513 /// Create a new `Vec<T, A>` and extend it by `n` clones of `value`.
523 impl<T, A> Drop for Vec<T, A> implementation
543 impl<T, A, const N: usize> From<Box<[T; N], A>> for Vec<T, A> implementation
547 fn from(b: Box<[T; N], A>) -> Vec<T, A> { in from()
557 unsafe { Vec::from_raw_parts(ptr as _, len, len) }
568 impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> { implementation
574 impl<T, A> Deref for Vec<T, A> implementation
588 impl<T, A> DerefMut for Vec<T, A> implementation
600 impl<T: Eq, A> Eq for Vec<T, A> where A: Allocator {} implementation
602 impl<T, I: SliceIndex<[T]>, A> Index<I> for Vec<T, A> implementation
614 impl<T, I: SliceIndex<[T]>, A> IndexMut<I> for Vec<T, A> implementation
639 [A1: Allocator, A2: Allocator] Vec<T, A1>, Vec<U, A2>,
640 [A: Allocator] Vec<T, A>, &[U],
641 [A: Allocator] Vec<T, A>, &mut [U],
642 [A: Allocator] &[T], Vec<U, A>,
643 [A: Allocator] &mut [T], Vec<U, A>,
644 [A: Allocator] Vec<T, A>, [U],
645 [A: Allocator] [T], Vec<U, A>,
646 [A: Allocator, const N: usize] Vec<T, A>, [U; N],
647 [A: Allocator, const N: usize] Vec<T, A>, &[U; N],
650 impl<'a, T, A> IntoIterator for &'a Vec<T, A> implementation
662 impl<'a, T, A: Allocator> IntoIterator for &'a mut Vec<T, A> implementation
674 /// An [`Iterator`] implementation for [`Vec`] that moves elements out of a vector.
676 /// This structure is created by the [`Vec::into_iter`] method on [`Vec`] (provided by the
708 /// Same as `Iterator::collect` but specialized for `Vec`'s `IntoIter`.
730 /// case where `I::IntoIter` equals `Vec`'s `IntoIter` type.
739 /// `Vec` again.
743 pub fn collect(self, flags: Flags) -> Vec<T, A> { in collect()
785 // `Vec`. in collect()
786 unsafe { Vec::from_raw_parts(ptr, len, cap) } in collect()
864 impl<T, A> IntoIterator for Vec<T, A> implementation
871 /// Consumes the `Vec<T, A>` and creates an `Iterator`, which moves each value out of the