pub struct UnsizedVec<T>where
T: ?Sized,{ /* private fields */ }
Expand description
Like Vec
, but can store unsized values.
§Memory layout
UnsizedVec
is actually three different types rolled in to one;
specialization is used to choose the optimal implementation based on the properties
of T
.
-
When
T
is aSized
type,UnsizedVec<T>
is a newtype aroundVec<T>
, with exactly the same memoy layout. -
When
T
is a slice, there are two heap allocations. The first is to the slices themsleves; they are laid out end-to-end, one after the other, with no padding in between. The second heap allocation is to a list of offsets, to store where each element begins and ends. -
When
T
is neither of the above, there are still two allocations. The first allocation still contains the elements of the vector laid out end-to-end, but now every element is padded to at least the alignment of the most-aligned element in theUnsizedVec
. For this reason, adding a new element to the vec with a larger alignment than any of the elements already in it will add new padding to all the existing elements, which will involve a lot of copying and probably a reallocation. By default,UnsizedVec::new
sets the alignment tocore::mem::align_of::<usize>()
, so as long as none of your trait objects are aligned to more than that, you won’t have to worry about re-padding. For this last case, the second allocation, in addition to storing offsets, also stores the pointer metadata of each element.
§Managing capacity
Vec<T>
has only one kind of capacity to worry about: elementwise capacity. And so does
UnsizedVec<T>
, as long as T: Sized
. You can use functions like capacity
, with_capacity
and reserve
to manage this capacity.
When T
is a slice, there are two kinds of capacities: element capacity and byte capacity.
Adding new elements to the vec is guaranteed not to reallocate as long as
the number of elements doesn’t exceed the element capacity and the total size of all
the elements in bytes doesn’t exceed the byte capacity. You can use functions like
byte_capacity
, with_capacity_bytes
, and reserve_capacity_bytes
to manage
these two capacities.
When T
is a trait object, there is a third type of capacity: alignment. To avoid
reallocation when adding a new element to the vec, you need to ensure that you have
sufficient element and byte capacity, and that the vec’s align is not less than the
alignment of the new element. Functions like align
, with_capacity_bytes_align
, and
reserve_capacity_bytes_align
, can be used to manage all three capacities in this case.
§Limitations
UnsizedVec<T>
is invariant with respect toT
; ideally, it should be covariant. This is because Rust forces invariance on all structs that contain associated types referencingT
. Hopefully, future language features will allow lifting this limitation.- Rust functions can’t directly return unsized types. So this crate’s functions return
them indirectly, though the “emplacer” mechanism defined in the
emplacable
crate. See that crate’s documentation for details, and the documentation ofpop_into
andremove_into
for usage examples.
§Example
#![allow(internal_features)] // for `unsized_fn_params`
#![feature(unsized_fn_params)]
use core::fmt::Debug;
use emplacable::box_new_with;
use unsized_vec::{unsize_vec, UnsizedVec};
let mut vec: UnsizedVec<dyn Debug> = unsize_vec![27.53_f32, "oh the places we'll go", Some(())];
for traitobj in &vec {
dbg!(traitobj);
};
assert_eq!(vec.len(), 3);
let maybe_popped: Option<Box<dyn Debug>> = vec.pop_into().map(box_new_with);
let popped = maybe_popped.unwrap();
dbg!(&*popped);
assert_eq!(vec.len(), 2);
Implementations§
Source§impl<T: ?Sized> UnsizedVec<T>
impl<T: ?Sized> UnsizedVec<T>
Sourcepub const fn new() -> UnsizedVec<T>
pub const fn new() -> UnsizedVec<T>
Create a new, empty UnsizedVec
.
Does not allocate.
When T
’s alignmnent is not known
at compile-time, this uses mem::align_of::<usize>()
as the default alignment.
Sourcepub fn with_capacity(capacity: usize) -> UnsizedVec<T>
pub fn with_capacity(capacity: usize) -> UnsizedVec<T>
Create a new, empty UnsizedVec
with the given capacity.
When T
’s alignmnent is not known
at compile-time, this uses mem::align_of::<usize>()
as the default alignment.
Sourcepub fn with_capacity_bytes(
capacity: usize,
byte_capacity: usize,
) -> UnsizedVec<T>
pub fn with_capacity_bytes( capacity: usize, byte_capacity: usize, ) -> UnsizedVec<T>
Create a new, empty UnsizedVec
with the given capacity.
(When T: Aligned
does not hold, an alignment of 1 is used.)
When T
’s alignmnent is not known
at compile-time, this uses mem::align_of::<usize>()
as the default alignment.
Sourcepub fn with_capacity_bytes_align(
capacity: usize,
byte_capacity: usize,
align: usize,
) -> UnsizedVec<T>
pub fn with_capacity_bytes_align( capacity: usize, byte_capacity: usize, align: usize, ) -> UnsizedVec<T>
Create a new, empty UnsizedVec
with the given capacity
(in bytes) and alignment.
align
is ignored when T
’s alignment is known at compile time
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the vector can hold without reallocating.
For T: ?Sized
, this only concers whether metadata
could get reallocated, not the elements themselves.
Sourcepub fn byte_capacity(&self) -> usize
pub fn byte_capacity(&self) -> usize
Returns the number of bytes the vector can hold without reallocating.
Sourcepub fn align(&self) -> usize
pub fn align(&self) -> usize
Returns the maximum alignment of the values this vector can hold without re-padding and reallocating.
Only relevant when T
’s alignment is not known at compile time.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be inserted
in the given UnsizedVec<T>
. The collection may reserve more space to
speculatively avoid frequent reallocations.
When T
is not Sized
, this only reseves space to store metadata.
Consider using reserve_capacity_bytes
instead in such cases.
§Panics
Panics if the new capacity exceeds isize::MAX
bytes.
Sourcepub fn reserve_capacity_bytes(
&mut self,
additional: usize,
additional_bytes: usize,
)
pub fn reserve_capacity_bytes( &mut self, additional: usize, additional_bytes: usize, )
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space, to be inserted
in the given UnsizedVec<T>
. The collection may reserve more space to
speculatively avoid frequent reallocations.
When T
’s alignment is not known at compile time,
the vec may still reallocate if you push a new element onto the
vec with an alignment greater than self.align()
. Consider
using reserve_capacity_bytes_align
instead in such cases.
§Panics
Panics if the either of the new capacities exceeds isize::MAX
bytes.
Sourcepub fn reserve_capacity_bytes_align(
&mut self,
additional: usize,
additional_bytes: usize,
align: usize,
)
pub fn reserve_capacity_bytes_align( &mut self, additional: usize, additional_bytes: usize, align: usize, )
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space,
and with alignment of at most align
, to be inserted
in the given UnsizedVec<T>
. The collection may reserve more space to
speculatively avoid frequent reallocations.
When T
’s alignment is known at compile time,
align
is ignored. Consider using reserve_capacity_bytes
instead in such cases.
§Panics
Panics if the either of the new capacities exceeds isize::MAX
bytes,
or if align
is not a power of two.
Sourcepub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be inserted
in the given UnsizedVec<T>
. Unlike reserve
, this will not
deliberately over-allocate to speculatively avoid frequent allocations.
When T
is not Sized
, this only reseves space to store metadata.
Consider using reserve_exact_capacity_bytes
instead in such cases.
§Panics
Panics if the new capacity exceeds isize::MAX
bytes.
Sourcepub fn reserve_exact_capacity_bytes(
&mut self,
additional: usize,
additional_bytes: usize,
)
pub fn reserve_exact_capacity_bytes( &mut self, additional: usize, additional_bytes: usize, )
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space, to be inserted
in the given UnsizedVec<T>
. Unlike reserve_capacity_bytes
, this will not
deliberately over-allocate to speculatively avoid frequent allocations.
When T
’s alignment is not known at compile time,
the vec may still reallocate if you push a new element onto the
vec with an alignment greater than self.align()
. Consider
using reserve_exact_capacity_bytes_align
instead in such cases.
§Panics
Panics if the new capacity exceeds isize::MAX
bytes.
Sourcepub fn reserve_exact_capacity_bytes_align(
&mut self,
additional: usize,
additional_bytes: usize,
align: usize,
)
pub fn reserve_exact_capacity_bytes_align( &mut self, additional: usize, additional_bytes: usize, align: usize, )
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space,
and with alignment of at most align
, to be inserted
in the given UnsizedVec<T>
. Unlike reserve_capacity_bytes_align
, this will not
deliberately over-allocate to speculatively avoid frequent allocations.
When T
’s alignment is known at compile time,
align
is ignored. Consider using reserve_exact_capacity_bytes
instead in such cases.
§Panics
Panics if the new capacity exceeds isize::MAX
bytes.
Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Reserves capacity for at least additional
more elements to be inserted
in the given UnsizedVec<T>
. The collection may reserve more space to
speculatively avoid frequent reallocations.
When T
is not Sized
, this only reseves space to store metadata.
Consider using try_reserve_capacity_bytes
instead in such cases.
§Errors
If the capacity overflows, or the allocator reports a failure, then an error is returned.
Sourcepub fn try_reserve_capacity_bytes(
&mut self,
additional: usize,
additional_bytes: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_capacity_bytes( &mut self, additional: usize, additional_bytes: usize, ) -> Result<(), TryReserveError>
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space, to be inserted
in the given UnsizedVec<T>
. The collection may reserve more space to
speculatively avoid frequent reallocations.
When T
’s alignment is not known at compile time,
the vec may still reallocate if you push a new element onto the
vec with an alignment greater than self.align()
. Consider
using try_reserve_capacity_bytes_align
instead in such cases.
§Errors
If the capacity overflows, or the allocator reports a failure, then an error is returned.
Sourcepub fn try_reserve_capacity_bytes_align(
&mut self,
additional: usize,
additional_bytes: usize,
align: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_capacity_bytes_align( &mut self, additional: usize, additional_bytes: usize, align: usize, ) -> Result<(), TryReserveError>
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space,
and with alignment of at most align
, to be inserted
in the given UnsizedVec<T>
. The collection may reserve more space to
speculatively avoid frequent reallocations.
When T
’s alignment is known at compile time,
align
is ignored. Consider using try_reserve_capacity_bytes
instead in such cases.
§Errors
If the capacity overflows, or the allocator reports a failure, then an error is returned.
§Panics
Panics if align
is not a power of two.
Sourcepub fn try_reserve_exact(
&mut self,
additional: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>
Reserves capacity for at least additional
more elements to be inserted
in the given UnsizedVec<T>
. Unlike try_reserve
, this will not
deliberately over-allocate to speculatively avoid frequent allocations.
When T
is not Sized
, this only reseves space to store metadata.
Consider using try_reserve_exact_capacity_bytes
instead in such cases.
§Errors
If the capacity overflows, or the allocator reports a failure, then an error is returned.
Sourcepub fn try_reserve_exact_capacity_bytes(
&mut self,
additional: usize,
additional_bytes: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_exact_capacity_bytes( &mut self, additional: usize, additional_bytes: usize, ) -> Result<(), TryReserveError>
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space, to be inserted
in the given UnsizedVec<T>
. Unlike try_reserve_capacity_bytes
, this will not
deliberately over-allocate to speculatively avoid frequent allocations.
When T
’s alignment is not known at compile time,
the vec may still reallocate if you push a new element onto the
vec with an alignment greater than self.align()
. Consider
using try_reserve_exact_capacity_bytes_align
instead in such cases.
§Errors
If the capacity overflows, or the allocator reports a failure, then an error is returned.
Sourcepub fn try_reserve_exact_capacity_bytes_align(
&mut self,
additional: usize,
additional_bytes: usize,
align: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_exact_capacity_bytes_align( &mut self, additional: usize, additional_bytes: usize, align: usize, ) -> Result<(), TryReserveError>
Reserves capacity for at least additional
more elements,
taking up at least additional_bytes
bytes of space,
and with alignment of at most align
, to be inserted
in the given UnsizedVec<T>
. Unlike try_reserve_capacity_bytes_align
, this will not
deliberately over-allocate to speculatively avoid frequent allocations.
When T
’s alignment is known at compile time,
align
is ignored. Consider using try_reserve_exact_capacity_bytes
instead in such cases.
§Errors
If the capacity overflows, or the allocator reports a failure, then an error is returned.
§Panics
Panics if align
is not a power of two.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks all the capacities of the vec as much as possible.
Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Shrinks the elementwise capacity of the vector with a lower bound.
The capacity will remain at least as large as both the length and the supplied value.
If the current capacity is less than the lower limit, this is a no-op.
For T: ?Sized
, this only effects elementwise capacity.
Consider using shrink_capacity_bytes_to
in such cases.
Sourcepub fn shrink_capacity_bytes_to(
&mut self,
min_capacity: usize,
min_byte_capacity: usize,
)
pub fn shrink_capacity_bytes_to( &mut self, min_capacity: usize, min_byte_capacity: usize, )
Shrinks the elementwise and byte capacities of the vector with lower bounds.
The capacities will remain at least as large as both the lengths and the supplied values.
If the current capacities are less than the lower limits, this is a no-op.
When T
’s alignment is not known at compile-time, this only effects elementwise
and bytewise capacities.
Consider using shrink_capacity_bytes_align_to
in such cases.
Sourcepub fn shrink_capacity_bytes_align_to(
&mut self,
min_capacity: usize,
min_byte_capacity: usize,
min_align: usize,
)
pub fn shrink_capacity_bytes_align_to( &mut self, min_capacity: usize, min_byte_capacity: usize, min_align: usize, )
Shrinks the elementwise, byte, and alignment capacities of the vector with lower bounds.
The capacities will remain at least as large as both the lengths and the supplied values.
If the current capacities are less than the lower limits, this is a no-op.
§Panics
Panics if min_align
is not a power of two.
Sourcepub fn insert(&mut self, index: usize, value: T)
pub fn insert(&mut self, index: usize, value: T)
Inserts an element at position index
within the vector, shifting all
elements after it to the right.
If T
is not Sized
, you will need
#![feature(unsized_fn_params)]
to call this.
You may also need the unsize
macro, which
requires additional nightly features.
Alternatively, you can use insert_unsize
,
which takes care of unsizing for you.
§Example
#![allow(internal_features)] // for `unsized_fn_params`
#![feature(allocator_api, ptr_metadata, unsized_fn_params)]
use core::fmt::Debug;
use emplacable::unsize;
use unsized_vec::UnsizedVec;
let mut vec: UnsizedVec<dyn Debug> = UnsizedVec::new();
vec.push(unsize!([1, 2], ([i32; 2]) -> dyn Debug));
vec.insert(0, unsize!("can you believe it", (&str) -> dyn Debug));
dbg!(&vec[0]);
Sourcepub fn insert_unsize<S>(&mut self, index: usize, value: S)where
S: Unsize<T>,
pub fn insert_unsize<S>(&mut self, index: usize, value: S)where
S: Unsize<T>,
Appends an element to the back of a collection after unsizing it.
§Examples
use core::fmt::Debug;
use unsized_vec::UnsizedVec;
let mut vec: UnsizedVec<dyn Debug> = UnsizedVec::new();
vec.push_unsize([1, 2]);
vec.insert_unsize(0, "can you believe it");
dbg!(&vec[0]);
Sourcepub fn insert_with(
&mut self,
index: usize,
value: Emplacable<T, impl EmplacableFn<T>>,
)
pub fn insert_with( &mut self, index: usize, value: Emplacable<T, impl EmplacableFn<T>>, )
Inserts an element at position index
within the vector, shifting all
elements after it to the right.
Accepts the element as an Emplacable<T, _>
instead of T
directly, analogously
to emplacable::box_new_with
.
§Example
#![allow(internal_features)] // for `unsized_fn_params`
#![feature(allocator_api, ptr_metadata, unsized_fn_params)]
use core::fmt::Debug;
use unsized_vec::{unsize_vec, UnsizedVec};
let mut vec_1: UnsizedVec<dyn Debug> = unsize_vec![32, "hello"];
let mut vec_2: UnsizedVec<dyn Debug> = unsize_vec![97];
vec_2.insert_with(0, vec_1.pop_into().unwrap());
assert_eq!(vec_1.len(), 1);
assert_eq!(vec_2.len(), 2);
dbg!(&vec_2[0]);
Sourcepub fn remove_into(
&mut self,
index: usize,
) -> Emplacable<T, impl EmplacableFn<T> + '_>
pub fn remove_into( &mut self, index: usize, ) -> Emplacable<T, impl EmplacableFn<T> + '_>
Removes and returns the element at position index
within the vector,
shifting all elements after it to the left.
Because T
might be unsized, and functions can’t return
unsized values directly, this method returns the element using
the “emplacer” mechanism. You can pass the returned Emplacable<T, _>
to a function like box_new_with
to get the contained T
.
§Example
use core::fmt::Debug;
use emplacable::box_new_with;
use unsized_vec::UnsizedVec;
let mut vec = UnsizedVec::<dyn Debug>::new();
vec.push_unsize("A beautiful day today innit");
vec.push_unsize("Quite right ol chap");
let popped: Box<dyn Debug> = box_new_with(vec.remove_into(0));
dbg!(&popped);
Sourcepub fn push(&mut self, value: T)
pub fn push(&mut self, value: T)
Appends an element to the back of a collection.
If T
is not Sized
, you will need
#![feature(unsized_fn_params)]
to call this.
You may also need the unsize
macro, which
requires additional nightly features.
Alternatively, you can use push_unsize
,
which takes care of unsizing for you.
§Example
#![allow(internal_features)] // for `unsized_fn_params`
#![feature(allocator_api, ptr_metadata, unsized_fn_params)]
use core::fmt::Debug;
use emplacable::unsize;
use unsized_vec::UnsizedVec;
let mut vec: UnsizedVec<dyn Debug> = UnsizedVec::new();
vec.push(unsize!([1, 2], ([i32; 2]) -> dyn Debug));
dbg!(&vec[0]);
Sourcepub fn push_unsize<S: Unsize<T>>(&mut self, value: S)
pub fn push_unsize<S: Unsize<T>>(&mut self, value: S)
Appends an element to the back of a collection after coercing it to an unsized type.
§Example
use core::fmt::Debug;
use unsized_vec::UnsizedVec;
let mut vec: UnsizedVec<dyn Debug> = UnsizedVec::new();
vec.push_unsize([1, 2]);
dbg!(&vec[0]);
Sourcepub fn push_with(&mut self, value: Emplacable<T, impl EmplacableFn<T>>)
pub fn push_with(&mut self, value: Emplacable<T, impl EmplacableFn<T>>)
Appends an element to the back of a collection.
Accepts the element as an Emplacable<T, _>
instead of T
directly, analogously
to emplacable::box_new_with
.
#![allow(internal_features)] // for `unsized_fn_params`
#![feature(allocator_api, ptr_metadata, unsized_fn_params)]
use core::fmt::Debug;
use unsized_vec::{unsize_vec, UnsizedVec};
let mut vec_1: UnsizedVec<dyn Debug> = unsize_vec![32, "hello"];
let mut vec_2: UnsizedVec<dyn Debug> = UnsizedVec::new();
vec_2.push_with(vec_1.pop_into().unwrap());
assert_eq!(vec_1.len(), 1);
dbg!(&vec_2[0]);
Sourcepub fn pop_into(&mut self) -> Option<Emplacable<T, impl EmplacableFn<T> + '_>>
pub fn pop_into(&mut self) -> Option<Emplacable<T, impl EmplacableFn<T> + '_>>
Removes the last element from a vector and returns it, or None
if it
is empty.
Because T
might be unsized, and functions can’t return
unsized values directly, this method returns the element using
the “emplacer” mechanism. You can pass the returned Emplacable<T, _>
to a function like box_new_with
to get the contained T
.
§Example
use core::fmt::Debug;
use emplacable::{box_new_with, Emplacable};
use unsized_vec::{UnsizedVec};
let mut vec = UnsizedVec::<dyn Debug>::new();
dbg!(vec.is_empty());
let nothing: Option<Box<dyn Debug>> = vec.pop_into().map(box_new_with);
assert!(nothing.is_none());
vec.push_unsize("A beautiful day today");
let popped: Option<Box<dyn Debug>> = vec.pop_into().map(box_new_with);
let unwrapped: Box<dyn Debug> = popped.unwrap();
dbg!(&unwrapped);
vec.push_unsize("innit?");
dbg!(&vec);
let mut popped_emplacable: Emplacable<dyn Debug, _> = vec.pop_into().unwrap();
// vec.push_unsize("yea"); // error: cannot borrow `vec` as mutable more than once at a time
// The `vec` will remain borrowed until you consume the `Emplacable`!
// or we can just drop it...
// dropping an `Emplacable` drops
// the contained value.
popped_emplacable;
assert!(vec.is_empty());
vec.push_unsize("yea"); // works now
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of elements in the vector, also referred to as its ‘length’.
Sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Returns a reference to an element,
or None
if index
is out of range.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Returns a mutable reference to an element,
or None
if index
is out of range.
Sourcepub unsafe fn get_unchecked(&self, index: usize) -> &T
pub unsafe fn get_unchecked(&self, index: usize) -> &T
Returns a reference to an element, without doing bounds checking.
§Safety
Calling this method with an out-of-bounds index is [undefined behavior] even if the resulting reference is not used.
Sourcepub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T
pub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T
Returns a mutable reference to an element, without doing bounds checking.
§Safety
Calling this method with an out-of-bounds index is [undefined behavior] even if the resulting reference is not used.
Sourcepub fn iter(&self) -> UnsizedIter<'_, T> ⓘ
pub fn iter(&self) -> UnsizedIter<'_, T> ⓘ
Returns an iterator over references to the elements of this vec.
Sourcepub fn iter_mut(&mut self) -> UnsizedIterMut<'_, T> ⓘ
pub fn iter_mut(&mut self) -> UnsizedIterMut<'_, T> ⓘ
Returns an iterator over mutable references to the elements of this vec.
Sourcepub fn unsize<U>(self) -> UnsizedVec<U>
pub fn unsize<U>(self) -> UnsizedVec<U>
Coerces this Vec’s elements to an unsized type.
§Example
use core::fmt::Debug;
use unsized_vec::UnsizedVec;
let sized: Vec<u32> = vec![3, 4, 5];
let unsize: UnsizedVec<dyn Debug> = UnsizedVec::unsize(sized.into());
dbg!(&unsize);
Trait Implementations§
Source§impl<T> Clone for UnsizedVec<T>where
T: Clone,
impl<T> Clone for UnsizedVec<T>where
T: Clone,
Source§impl<T> Debug for UnsizedVec<T>
impl<T> Debug for UnsizedVec<T>
Source§impl<T> Default for UnsizedVec<T>where
T: ?Sized,
impl<T> Default for UnsizedVec<T>where
T: ?Sized,
Source§impl<T, F> Extend<Emplacable<T, F>> for UnsizedVec<T>where
T: ?Sized,
F: EmplacableFn<T>,
impl<T, F> Extend<Emplacable<T, F>> for UnsizedVec<T>where
T: ?Sized,
F: EmplacableFn<T>,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Emplacable<T, F>>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Emplacable<T, F>>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)