#[repr(C)]pub struct AllocSlice<T, Alloc> {
pub start: AllocPtr<T, Alloc>,
pub end: NonNull<T>,
}Expand description
A helper to work with allocated slices.
Fields§
§start: AllocPtr<T, Alloc>The start of the slice.
end: NonNull<T>The end of the slice (exclusive).
Implementations§
Source§impl<T, Alloc> AllocSlice<T, Alloc>
impl<T, Alloc> AllocSlice<T, Alloc>
Sourcepub const fn has_optimal_layout() -> bool
pub const fn has_optimal_layout() -> bool
Returns true if the layout for AllocSlice is smaller or equal to that Rust would have generated for it.
Trait Implementations§
Source§impl<T, Alloc> Clone for AllocSlice<T, Alloc>
impl<T, Alloc> Clone for AllocSlice<T, Alloc>
Source§impl<T, Alloc> IStable for AllocSlice<T, Alloc>
impl<T, Alloc> IStable for AllocSlice<T, Alloc>
Source§const REPORT: &'static TypeReport
const REPORT: &'static TypeReport
A compile-time generated report of the fields of the type, allowing for compatibility inspection.
Source§const ID: u64
const ID: u64
A stable (and ideally unique) identifier for the type. Often generated using
crate::report::gen_id, but can be manually set.Source§type ForbiddenValues = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::ForbiddenValues
type ForbiddenValues = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::ForbiddenValues
The values that the annotated type cannot occupy.
Source§type UnusedBits = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::UnusedBits
type UnusedBits = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::UnusedBits
The padding bits in the annotated types
Source§type Size = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::Size
type Size = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::Size
The size of the annotated type in bytes.
Source§type Align = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::Align
type Align = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::Align
The alignment of the annotated type in bytes.
Source§type HasExactlyOneNiche = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::HasExactlyOneNiche
type HasExactlyOneNiche = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::HasExactlyOneNiche
Allows the detection of whether or not
core::option::Options are stable: Read moreSource§type ContainsIndirections = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::ContainsIndirections
type ContainsIndirections = <Struct<FieldPair<AllocPtr<T, Alloc>, NonNull<T>>> as IStable>::ContainsIndirections
Whether or not the type contains indirections (pointers, indices in independent data-structures…)
Source§impl<T: Ord, Alloc: Ord> Ord for AllocSlice<T, Alloc>
impl<T: Ord, Alloc: Ord> Ord for AllocSlice<T, Alloc>
Source§fn cmp(&self, other: &AllocSlice<T, Alloc>) -> Ordering
fn cmp(&self, other: &AllocSlice<T, Alloc>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd, Alloc: PartialOrd> PartialOrd for AllocSlice<T, Alloc>
impl<T: PartialOrd, Alloc: PartialOrd> PartialOrd for AllocSlice<T, Alloc>
impl<T, Alloc> Copy for AllocSlice<T, Alloc>
impl<T: Eq, Alloc: Eq> Eq for AllocSlice<T, Alloc>
impl<T, Alloc> StructuralPartialEq for AllocSlice<T, Alloc>
Auto Trait Implementations§
impl<T, Alloc> Freeze for AllocSlice<T, Alloc>
impl<T, Alloc> RefUnwindSafe for AllocSlice<T, Alloc>where
Alloc: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Alloc> !Send for AllocSlice<T, Alloc>
impl<T, Alloc> !Sync for AllocSlice<T, Alloc>
impl<T, Alloc> Unpin for AllocSlice<T, Alloc>where
Alloc: Unpin,
impl<T, Alloc> UnwindSafe for AllocSlice<T, Alloc>where
T: RefUnwindSafe,
Alloc: UnwindSafe,
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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