Lines Matching full:capacity
10 /// Creates a new [`Vec`] instance with at least the given capacity.
17 /// assert!(v.capacity() >= 20);
20 fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError>; in with_capacity()
56 /// Ensures that the capacity exceeds the length by at least `additional` elements.
65 /// let cap = v.capacity();
69 /// let new_cap = v.capacity();
78 fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> { in with_capacity()
80 <Self as VecExt<_>>::reserve(&mut v, capacity, flags)?; in with_capacity()
90 // by 1. We also know that the new length is <= capacity because of the previous call to in push()
106 // the length by the same amount. We also know that the new length is <= capacity because in extend_from_slice()
121 let cap = self.capacity(); in reserve()
128 // The capacity is already `usize::MAX` for SZTs, we can't go higher. in reserve()
141 // dangling after being created with `Vec::new`. Instead, we can rely on `Vec<T>`'s capacity in reserve()
171 let cap = tmp.capacity(); in destructure()
175 /// Rebuilds a `Vec` from a pointer, length, and capacity.