[−][src]Struct aligned_bytes::AlignedBox
Aligned heap allocation
Implementations
impl<T> AlignedBox<T>
[src]
pub fn new(x: T, align: usize) -> Self
[src]
Allocates memory on the heap with specified alignment and then places x into it.
This doesn't actually allocate if T is zero-sized.
impl<T: ?Sized> AlignedBox<T>
[src]
pub fn into_raw(this: Self) -> (*mut T, usize)
[src]
Consumes the box, returning a raw pointer and alignment.
pub unsafe fn from_raw(ptr: *mut T, align: usize) -> Self
[src]
Constructs a aligned box from a raw pointer and alignment
Safety
ptr
must be non-null and well aligned foralign
ptr
must be allocated with the global allocator
pub fn alignment(this: &Self) -> usize
[src]
Returns the alignment of the box
Trait Implementations
impl<T: ?Sized + Debug> Debug for AlignedBox<T>
[src]
impl<T: ?Sized> Deref for AlignedBox<T>
[src]
impl<T: ?Sized> DerefMut for AlignedBox<T>
[src]
impl<T: ?Sized> Drop for AlignedBox<T>
[src]
impl<T: ?Sized + RefUnwindSafe> RefUnwindSafe for AlignedBox<T>
[src]
impl<T: ?Sized + Send> Send for AlignedBox<T>
[src]
impl<T: ?Sized + Sync> Sync for AlignedBox<T>
[src]
impl<T: ?Sized + UnwindSafe> UnwindSafe for AlignedBox<T>
[src]
Auto Trait Implementations
impl<T: ?Sized> Unpin for AlignedBox<T> where
T: Unpin,
[src]
T: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,