pub struct Ox<T: ?Sized, const A: u8, const S: bool, const V: u8>(/* private fields */);Expand description
A Box that we stole the high bits off.
T: type pointed to. V: number of bits to steal directly by masking them off. A: number of bits to steal based on the alignment requirements of T.
Implementations§
Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Ox<T, A, S, V>
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Ox<T, A, S, V>
Sourcepub unsafe fn new(boxed: Box<T>) -> Self
pub unsafe fn new(boxed: Box<T>) -> Self
Creates a new Ox from a box.
§Safety
- T’s alignment must enable stealing A bits.
- The high bits (sign upwards) must match a stack pointer’s high bits.
- If compiling for a 64bit arch, V must be at most 25.
- If compiling for a non-64bit arch, V must be 0.
These invariants are checked with debug_assert only, hence
unsafe. The usual caveats of pointers apply.
Sourcepub unsafe fn new_stealing(boxed: Box<T>, bits: usize) -> Self
pub unsafe fn new_stealing(boxed: Box<T>, bits: usize) -> Self
Trait Implementations§
Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Clone for Ox<T, A, S, V>
Available on crate feature alloc only.
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Clone for Ox<T, A, S, V>
Available on crate feature
alloc only.Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Deref for Ox<T, A, S, V>
Available on crate feature alloc only.
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Deref for Ox<T, A, S, V>
Available on crate feature
alloc only.Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> DerefMut for Ox<T, A, S, V>
Available on crate feature alloc only.
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> DerefMut for Ox<T, A, S, V>
Available on crate feature
alloc only.Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Drop for Ox<T, A, S, V>
Available on crate feature alloc only.
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Drop for Ox<T, A, S, V>
Available on crate feature
alloc only.Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Hash for Ox<T, A, S, V>
Available on crate feature alloc only.
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Hash for Ox<T, A, S, V>
Available on crate feature
alloc only.Source§impl<T: ?Sized, const A: u8, const S: bool, const V: u8> PartialEq for Ox<T, A, S, V>
Available on crate feature alloc only.
impl<T: ?Sized, const A: u8, const S: bool, const V: u8> PartialEq for Ox<T, A, S, V>
Available on crate feature
alloc only.impl<T: ?Sized, const A: u8, const S: bool, const V: u8> Eq for Ox<T, A, S, V>
Available on crate feature
alloc only.Auto Trait Implementations§
impl<T, const A: u8, const S: bool, const V: u8> Freeze for Ox<T, A, S, V>where
T: ?Sized,
impl<T, const A: u8, const S: bool, const V: u8> RefUnwindSafe for Ox<T, A, S, V>where
T: RefUnwindSafe + ?Sized,
impl<T, const A: u8, const S: bool, const V: u8> !Send for Ox<T, A, S, V>
impl<T, const A: u8, const S: bool, const V: u8> !Sync for Ox<T, A, S, V>
impl<T, const A: u8, const S: bool, const V: u8> Unpin for Ox<T, A, S, V>where
T: ?Sized,
impl<T, const A: u8, const S: bool, const V: u8> UnwindSafe for Ox<T, A, S, V>where
T: RefUnwindSafe + ?Sized,
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