pub struct UnpodStack<'a> { /* private fields */ }
Expand description
Owns an unsized array of data, allocated from some stack.
Methods from Deref<Target = DynStack>§
sourcepub fn can_hold(&self, alloc_req: StackReq) -> bool
pub fn can_hold(&self, alloc_req: StackReq) -> bool
Returns true
if the stack can hold an allocation with the given size and alignment
requirements.
sourcepub fn as_ptr(&self) -> *const u8
pub fn as_ptr(&self) -> *const u8
Returns a pointer to the (possibly uninitialized) stack memory.
sourcepub fn make_aligned_uninit<T>(
&mut self,
size: usize,
align: usize,
) -> (DynArray<'_, MaybeUninit<T>>, &mut Self)
pub fn make_aligned_uninit<T>( &mut self, size: usize, align: usize, ) -> (DynArray<'_, MaybeUninit<T>>, &mut Self)
sourcepub fn make_aligned_with<T>(
&mut self,
size: usize,
align: usize,
f: impl FnMut(usize) -> T,
) -> (DynArray<'_, T>, &mut Self)
pub fn make_aligned_with<T>( &mut self, size: usize, align: usize, f: impl FnMut(usize) -> T, ) -> (DynArray<'_, T>, &mut Self)
sourcepub fn make_uninit<T>(
&mut self,
size: usize,
) -> (DynArray<'_, MaybeUninit<T>>, &mut Self)
pub fn make_uninit<T>( &mut self, size: usize, ) -> (DynArray<'_, MaybeUninit<T>>, &mut Self)
sourcepub fn make_with<T>(
&mut self,
size: usize,
f: impl FnMut(usize) -> T,
) -> (DynArray<'_, T>, &mut Self)
pub fn make_with<T>( &mut self, size: usize, f: impl FnMut(usize) -> T, ) -> (DynArray<'_, T>, &mut Self)
sourcepub fn collect_aligned<I: IntoIterator>(
&mut self,
align: usize,
iter: I,
) -> (DynArray<'_, I::Item>, &mut Self)
pub fn collect_aligned<I: IntoIterator>( &mut self, align: usize, iter: I, ) -> (DynArray<'_, I::Item>, &mut Self)
Returns a new aligned DynArray
, initialized with the provided iterator, and a stack
over the remainder of the buffer.
If there isn’t enough space for all the iterator items, then the returned array only
contains the first elements that fit into the stack.
§Panics
Panics if the provided iterator panics.
sourcepub fn collect<I: IntoIterator>(
&mut self,
iter: I,
) -> (DynArray<'_, I::Item>, &mut Self)
pub fn collect<I: IntoIterator>( &mut self, iter: I, ) -> (DynArray<'_, I::Item>, &mut Self)
Trait Implementations§
source§impl<'a> Deref for UnpodStack<'a>
impl<'a> Deref for UnpodStack<'a>
source§impl<'a> DerefMut for UnpodStack<'a>
impl<'a> DerefMut for UnpodStack<'a>
source§impl<'a> Drop for UnpodStack<'a>
impl<'a> Drop for UnpodStack<'a>
impl<'a> Send for UnpodStack<'a>
impl<'a> Sync for UnpodStack<'a>
Auto Trait Implementations§
impl<'a> Freeze for UnpodStack<'a>
impl<'a> RefUnwindSafe for UnpodStack<'a>
impl<'a> Unpin for UnpodStack<'a>
impl<'a> UnwindSafe for UnpodStack<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more