Struct cl_arena::dropless_arena::DroplessArena

source ·
pub struct DroplessArena<'arena> { /* private fields */ }

Implementations§

source§

impl<'arena> DroplessArena<'arena>

source

pub const fn new() -> Self

source

pub fn alloc<T>(&'arena self, value: T) -> &'arena mut T

Allocates a T in the DroplessArena, and returns a mutable reference to it.

§Panics
  • Panics if T implements Drop
  • Panics if T is zero-sized
source

pub fn alloc_slice<T: Copy>(&'arena self, slice: &[T]) -> &'arena mut [T]

Allocates a slice of Ts`, copied from the given slice, returning a mutable reference to it.

§Panics
  • Panics if T implements Drop
  • Panics if T is zero-sized
  • Panics if the slice is empty
source

pub fn alloc_str(&'arena self, string: &str) -> &'arena str

Allocates a copy of the given &str, returning a reference to the allocation.

§Panics

Panics if the string is empty.

source

pub fn alloc_raw(&'arena self, layout: Layout) -> *mut u8

Allocates some bytes based on the given Layout.

§Panics

Panics if the provided Layout has size 0

source

pub fn contains_slice<T>(&self, slice: &[T]) -> bool

Checks whether the given slice is allocated in this arena

Trait Implementations§

source§

impl Default for DroplessArena<'_>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'arena> Send for DroplessArena<'arena>

Auto Trait Implementations§

§

impl<'arena> !Freeze for DroplessArena<'arena>

§

impl<'arena> !RefUnwindSafe for DroplessArena<'arena>

§

impl<'arena> !Sync for DroplessArena<'arena>

§

impl<'arena> Unpin for DroplessArena<'arena>

§

impl<'arena> UnwindSafe for DroplessArena<'arena>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.