pub struct AlignBox<T> { /* private fields */ }

Implementations§

source§

impl<T> AlignBox<T>

source

pub fn as_ptr(&self) -> *mut T

Gets a raw pointer to the start of the allocation. Note that this is Unique::empty() if cap = 0 or T is zero-sized. In the former case, you must be careful.

source§

impl<T> AlignBox<T>

source

pub fn new() -> Option<AlignBox<T>>

source

pub fn new_with_align(align: usize) -> Option<AlignBox<T>>

source

pub fn new_with_req(align: usize, align_req: &[AlignReq]) -> Option<AlignBox<T>>

source§

impl<T> AlignBox<T>

source

pub fn heap_init<F>(initialize: F) -> Option<AlignBox<T>>where F: Fn(&mut T),

source

pub fn heap_init_with_align<F>( initialize: F, align: usize ) -> Option<AlignBox<T>>where F: Fn(&mut T),

source

pub fn heap_init_with_req<F>( initialize: F, align: usize, data: &[AlignReq] ) -> Option<AlignBox<T>>where F: Fn(&mut T),

Trait Implementations§

source§

impl<T> AsMut<T> for AlignBox<T>

source§

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

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<T> for AlignBox<T>

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Borrow<T> for AlignBox<T>

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for AlignBox<T>

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T: Clone> Clone for AlignBox<T>

source§

fn clone(&self) -> AlignBox<T>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &AlignBox<T>)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for AlignBox<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Deref for AlignBox<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T> DerefMut for AlignBox<T>

source§

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

Mutably dereferences the value.
source§

impl<T: Display> Display for AlignBox<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Drop for AlignBox<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for AlignBox<T>where T: RefUnwindSafe,

§

impl<T> Send for AlignBox<T>where T: Send,

§

impl<T> Sync for AlignBox<T>where T: Sync,

§

impl<T> Unpin for AlignBox<T>where T: Unpin,

§

impl<T> UnwindSafe for AlignBox<T>where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.