Struct aligned_vec::ABox
source · pub struct ABox<T: ?Sized, A: Alignment = ConstAlign<CACHELINE_ALIGN>> { /* private fields */ }
Expand description
Aligned box. See Box
for more info.
Note: passing an alignment value of 0
or a power of two that is less than the minimum alignment will cause the vector to use the minimum valid alignment for the type T
and alignment type A
.
Implementations§
source§impl<T: ?Sized, A: Alignment> ABox<T, A>
impl<T: ?Sized, A: Alignment> ABox<T, A>
sourcepub unsafe fn from_raw_parts(align: usize, ptr: *mut T) -> Self
pub unsafe fn from_raw_parts(align: usize, ptr: *mut T) -> Self
Creates a new ABox<T>
from its raw parts.
§Safety
The arguments to this function must be acquired from a previous call to
Self::into_raw_parts
.
sourcepub fn into_raw_parts(this: Self) -> (*mut T, usize)
pub fn into_raw_parts(this: Self) -> (*mut T, usize)
Decomposes a ABox<T>
into its raw parts: (ptr, alignment)
.
Trait Implementations§
source§impl<'de, T: Deserialize<'de>, const N: usize> Deserialize<'de> for ABox<[T], ConstAlign<N>>
Available on crate feature serde
only.
impl<'de, T: Deserialize<'de>, const N: usize> Deserialize<'de> for ABox<[T], ConstAlign<N>>
Available on crate feature
serde
only.source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'de, T: Deserialize<'de>, const N: usize> Deserialize<'de> for ABox<T, ConstAlign<N>>
Available on crate feature serde
only.
impl<'de, T: Deserialize<'de>, const N: usize> Deserialize<'de> for ABox<T, ConstAlign<N>>
Available on crate feature
serde
only.source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Ord + ?Sized, A: Alignment> Ord for ABox<T, A>
impl<T: Ord + ?Sized, A: Alignment> Ord for ABox<T, A>
source§impl<T: PartialEq + ?Sized, A: Alignment> PartialEq for ABox<T, A>
impl<T: PartialEq + ?Sized, A: Alignment> PartialEq for ABox<T, A>
source§impl<T: PartialOrd + ?Sized, A: Alignment> PartialOrd for ABox<T, A>
impl<T: PartialOrd + ?Sized, A: Alignment> PartialOrd for ABox<T, A>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T: ?Sized + Serialize, A: Alignment> Serialize for ABox<T, A>
Available on crate feature serde
only.
impl<T: ?Sized + Serialize, A: Alignment> Serialize for ABox<T, A>
Available on crate feature
serde
only.impl<T: Eq + ?Sized, A: Alignment> Eq for ABox<T, A>
impl<T: ?Sized + Send, A: Alignment + Send> Send for ABox<T, A>
impl<T: ?Sized + Sync, A: Alignment + Sync> Sync for ABox<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for ABox<T, A>
impl<T, A> RefUnwindSafe for ABox<T, A>
impl<T, A> Unpin for ABox<T, A>
impl<T, A> UnwindSafe for ABox<T, 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)