Lines Matching refs:with

3 //! A contiguous growable array type with heap-allocated contents, written
13 //! You can explicitly create a [`Vec`] with [`Vec::new`]:
185 /// It can also initialize each element of a `Vec<T>` with a given value.
265 /// elements that will be added onto the vector. This is not to be confused with
271 /// For example, a vector with capacity 10 and length 0 would be an empty vector
272 /// with space for 10 more elements. Pushing 10 or fewer elements onto the
293 /// if you construct a `Vec` with capacity 0 via [`Vec::new`], [`vec![]`][`vec!`],
310 /// A vector containing the elements `'a'` and `'b'` with capacity 4 can be
362 /// with exactly the requested capacity. If <code>[len] == [capacity]</code>,
427 /// Constructs a new, empty `Vec<T>` with at least the specified capacity.
485 /// Tries to construct a new, empty `Vec<T>` with at least the specified capacity.
549 /// * `T` needs to have the same alignment as what `ptr` was allocated with.
552 /// allocated and deallocated with the same layout.)
554 /// to be the same size as the pointer was allocated with. (Because similar to
555 /// alignment, [`dealloc`] must be called with the same layout `size`.)
558 /// * `capacity` needs to be the capacity that the pointer was allocated with.
568 /// to build a `Vec<u8>` from a pointer to a C `char` array with length
573 /// alignments. The buffer was allocated with alignment 2 (for `u16`), but after
574 /// turning it into a `Vec<u8>` it'll be deallocated with alignment 1. To avoid
607 /// // Overwrite memory with 4, 5, 6
669 /// Constructs a new, empty `Vec<T, A>` with at least the specified capacity
670 /// with the provided allocator.
731 /// Tries to construct a new, empty `Vec<T, A>` with at least the specified capacity
732 /// with the provided allocator.
800 /// * `T` needs to have the same alignment as what `ptr` was allocated with.
803 /// allocated and deallocated with the same layout.)
805 /// to be the same size as the pointer was allocated with. (Because similar to
806 /// alignment, [`dealloc`] must be called with the same layout `size`.)
809 /// * `capacity` needs to [*fit*] the layout size that the pointer was allocated with.
819 /// to build a `Vec<u8>` from a pointer to a C `char` array with length `size_t`.
822 /// alignments. The buffer was allocated with alignment 2 (for `u16`), but after
823 /// turning it into a `Vec<u8>` it'll be deallocated with alignment 1.
863 /// // Overwrite memory with 4, 5, 6
915 /// into a `Vec` with the [`from_raw_parts`] function, allowing
952 /// into a `Vec` with the [`from_raw_parts_in`] function, allowing
1159 // by only calling it with a greater capacity.
1165 /// Shrinks the capacity of the vector with a lower bound.
1194 /// newly-allocated buffer with exactly the right capacity.
1525 // We replace self[index] with the last element. Note that if the
1768 // SAFETY: `deleted_cnt` > 0, so the hole slot must not overlap with current element.
1919 /* Technically we could let `gap` clean up with its Drop, but
1980 /// with the element.
2226 /// the elements `[0, at)` with its previous capacity unchanged.
2282 /// difference, with each additional slot filled with the result of
2355 /// The returned slice can be used to fill the vector with data (e.g. by
2394 /// Returns vector content as a slice of `T`, along with the remaining spare
2397 /// The returned spare capacity slice can be used to fill the vector with data
2403 /// Note that this is a low-level API, which should be used with care for
2471 // - `spare_ptr` is pointing one element past the buffer, so it doesn't overlap with `initialized`
2485 /// difference, with each additional slot filled with `value`.
2520 /// difference, with each additional slot filled with `value`.
2562 /// specialized to work with slices instead. If and when Rust gets
2587 /// specialized to work with slices instead. If and when Rust gets
2811 // - Element was just initialized with `MaybeUninit::write`, so it's ok to increase len
2831 // anything with the original values
2876 // HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
2878 // `slice::to_vec` function which is only available with cfg(test)
3149 /// with the given `replace_with` iterator and yields the removed items.
3200 /// Use [`retain`] with a negated predicate if you do not need the returned iterator.
3478 /// newly-allocated buffer with exactly the right capacity.
3501 /// Allocate a `Vec<u8>` and fill it with a UTF-8 string.
3533 /// If you're fine with just getting a prefix of the `Vec<T>`,