pub struct Layout<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T> Layout<T>
impl<T> Layout<T>
Sourcepub const fn new(nrows: usize, ncols: usize) -> Result<Self, LayoutError>
pub const fn new(nrows: usize, ncols: usize) -> Result<Self, LayoutError>
Construct a new Layout, validating the following:
nrows * ncolsdoes not exceedusize::MAX.nrows * ncols * std::mem::size_of::<T>()does not exceedisize::MAX(the maximum addressable byte span).
Sourcepub fn num_elements(&self) -> usize
pub fn num_elements(&self) -> usize
Return the product self.nrows() * self.ncols().
Trait Implementations§
impl<T> Copy for Layout<T>
impl<T> Eq for Layout<T>
Auto Trait Implementations§
impl<T> Freeze for Layout<T>
impl<T> RefUnwindSafe for Layout<T>
impl<T> Send for Layout<T>
impl<T> Sync for Layout<T>
impl<T> Unpin for Layout<T>
impl<T> UnsafeUnpin for Layout<T>
impl<T> UnwindSafe for Layout<T>
Blanket Implementations§
impl<T> AsyncFriendly for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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