pub struct BoxedSliceLayout;
Expand description
Enables storing a boxed slice into an ArcSlice
without requiring the allocation of an inner
Arc, as long as there is a single instance.
As soon as the ArcSlice
is cloned (or subsliced), then an inner Arc is allocated. As a
consequence, when oom-handling
feature is not enabled,
ArcSlice<S, BoxedSliceLayout>
doesn’t implement Clone
.
When initializing an ArcSlice
with a vector, there will be no Arc allocation if the
vector has no spare capacity.
assert_eq!(
size_of::<ArcBytes<BoxedSliceLayout>>(),
3 * size_of::<usize>()
);
Trait Implementations§
Source§impl Debug for BoxedSliceLayout
impl Debug for BoxedSliceLayout
impl AnyBufferLayout for BoxedSliceLayout
impl Layout for BoxedSliceLayout
impl StaticLayout for BoxedSliceLayout
Auto Trait Implementations§
impl Freeze for BoxedSliceLayout
impl RefUnwindSafe for BoxedSliceLayout
impl Send for BoxedSliceLayout
impl Sync for BoxedSliceLayout
impl Unpin for BoxedSliceLayout
impl UnwindSafe for BoxedSliceLayout
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more