Struct nslice::MinSlice [−][src]
Expand description
A reference to a region of memory which is known to contain N or more elements
of type T.
Much like [T] itself, it is not possible to construct an owned MinSlice.
MinSlice is merely a way of reinterpreting an existing slice
(&[T] or &mut [T]), and it is exactly the same size as a slice:
one pointer and one usize.
Fields
head: [T; N]The bounded region of memory. Exactly N Ts.
tail: [T]Zero or more remaining Ts after the N in the bounded region.
Implementations
Produce a &MinSlice from a slice of Ts.
Returns None if there are not enough elements in slice.
Produce a &mut MinSlice from a mutable slice of Ts.
Returns None if there are not enough elements in slice.
Produce a &MinSlice from a slice of Ts without checking its length.
Safety
The caller is responsible for upholding the length invariant
slice.len() >= N, in addition to all normal slice invariants.
Produce a &mut MinSlice from a slice of Ts without checking its length.
Safety
The caller is responsible for upholding the length invariant
slice.len() >= N, in addition to all normal slice invariants.
Auto Trait Implementations
impl<T, const N: usize> RefUnwindSafe for MinSlice<T, N> where
T: RefUnwindSafe, impl<T, const N: usize> UnwindSafe for MinSlice<T, N> where
T: UnwindSafe,