[][src]Struct coca::arena::Box

pub struct Box<'src, T: ?Sized> { /* fields omitted */ }

A pointer type providing ownership of an arena allocation.

While the owned value will be dropped as normal, no additional overhead for memory management is incurred.

See the module-level documentation for more.

Implementations

impl<'src, T: Sized> Box<'src, MaybeUninit<T>>[src]

pub unsafe fn assume_init(self) -> Box<'src, T>

Notable traits for Box<'_, I>

impl<I: Iterator + ?Sized> Iterator for Box<'_, I> type Item = I::Item;
[src]

Converts self into a pointer to T.

Safety

It is up to the caller to guarantee that the MaybeUninit<T> really is in an initialized state. Calling this when the content is not yet fully initialized causes undefined behavior.

See the type-level documentation on MaybeUninit for more information about this initialization invariant.

pub fn init(self, x: T) -> Box<'src, T>

Notable traits for Box<'_, I>

impl<I: Iterator + ?Sized> Iterator for Box<'_, I> type Item = I::Item;
[src]

Places x into the allocation and converts self into a pointer to T.

See Arena::try_reserve for example usage.

impl<'src, T: Sized> Box<'src, [MaybeUninit<T>]>[src]

pub unsafe fn assume_init(self) -> Box<'src, [T]>

Notable traits for Box<'_, I>

impl<I: Iterator + ?Sized> Iterator for Box<'_, I> type Item = I::Item;
[src]

Converts self into a pointer to [T].

Safety

It is up to the caller to guarantee that each MaybeUninit<T> in the slice really is in an initialized state. Calling this when the content is not yet fully initialized causes undefined behavior.

See the type-level documentation on MaybeUninit for more information about this initialization invariant.

pub fn init_with<F: Fn(usize) -> T>(self, f: F) -> Box<'src, [T]>

Notable traits for Box<'_, I>

impl<I: Iterator + ?Sized> Iterator for Box<'_, I> type Item = I::Item;
[src]

Calls f once with each index into self, placing the returned value at that position, and then converts self into a pointer to [T].

See Arena::try_reserve_array for example usage.

Trait Implementations

impl<T: ?Sized> AsMut<T> for Box<'_, T>[src]

impl<T: ?Sized> AsRef<T> for Box<'_, T>[src]

impl<'a, T, const C: usize> ContiguousStorage<T> for Box<'a, [MaybeUninit<T>; C]>[src]

This is supported on crate feature nightly only.

impl<T: Debug + ?Sized> Debug for Box<'_, T>[src]

impl<T: ?Sized> Deref for Box<'_, T>[src]

type Target = T

The resulting type after dereferencing.

impl<T: ?Sized> DerefMut for Box<'_, T>[src]

impl<T: Display + ?Sized> Display for Box<'_, T>[src]

impl<T: ?Sized> Drop for Box<'_, T>[src]

impl<T: ?Sized + Eq> Eq for Box<'_, T>[src]

impl<'buf> From<Writer<'_, 'buf>> for Box<'buf, str>[src]

impl<T: ?Sized + Hash> Hash for Box<'_, T>[src]

impl<T: ?Sized + Hasher> Hasher for Box<'_, T>[src]

impl<I: Iterator + ?Sized> Iterator for Box<'_, I>[src]

type Item = I::Item

The type of the elements being iterated over.

impl<T: ?Sized + Ord> Ord for Box<'_, T>[src]

impl<T: ?Sized + PartialEq> PartialEq<Box<'_, T>> for Box<'_, T>[src]

impl<T: ?Sized + PartialOrd> PartialOrd<Box<'_, T>> for Box<'_, T>[src]

impl<T: ?Sized> Pointer for Box<'_, T>[src]

Auto Trait Implementations

impl<'src, T> !Send for Box<'src, T>[src]

impl<'src, T> !Sync for Box<'src, T>[src]

impl<'src, T: ?Sized> Unpin for Box<'src, T> where
    T: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.