pub enum Entry<T: ForeignOwnable> {
Int(Value),
Pointer(T),
}Expand description
An entry is either an Entry::Int integer (0..=usize::MAX >> 1) or an owned
Entry::Pointer.
Empty slots are represented by None, not a separate variant.
Integer values are validated by Value. Pointer alignment (T::FOREIGN_ALIGN >= 4) is a
requirement of the slot encoding, enforced at compile time when an XArray over T is
constructed (see the XArray invariants); Entry itself carries no invariants.
Variants§
Implementations§
Source§impl<T: ForeignOwnable> Entry<T>
impl<T: ForeignOwnable> Entry<T>
Sourcepub const fn int<const V: usize>() -> Self
pub const fn int<const V: usize>() -> Self
Creates an Entry::Int validated at compile time.
Fails to compile if V > usize::MAX >> 1.
Auto Trait Implementations§
impl<T> Freeze for Entry<T>where
T: Freeze,
impl<T> RefUnwindSafe for Entry<T>where
T: RefUnwindSafe,
impl<T> Send for Entry<T>where
T: Send,
impl<T> Sync for Entry<T>where
T: Sync,
impl<T> Unpin for Entry<T>where
T: Unpin,
impl<T> UnsafeUnpin for Entry<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Entry<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
Convert
self into a T. This operation is guaranteed to be lossless.