pub struct StackReq {
pub size: usize,
pub align: usize,
}Expand description
Represents the memory requirements for an operation.
This is used to pre-compute the scratch space needed for algorithms, allowing efficient allocation strategies.
Fields§
§size: usizeSize in bytes.
align: usizeAlignment in bytes.
Implementations§
Source§impl StackReq
impl StackReq
Sourcepub const fn new_for<T>(count: usize) -> Self
pub const fn new_for<T>(count: usize) -> Self
Creates a requirement for a given type and count.
Sourcepub const fn and(self, other: Self) -> Self
pub const fn and(self, other: Self) -> Self
Combines two requirements (both must be satisfied).
Sourcepub const fn or(self, other: Self) -> Self
pub const fn or(self, other: Self) -> Self
Takes the maximum of two requirements (either one is sufficient).
Sourcepub const fn with_align(self, align: usize) -> Self
pub const fn with_align(self, align: usize) -> Self
Returns the requirement aligned to a larger alignment.
Trait Implementations§
impl Copy for StackReq
impl Eq for StackReq
impl StructuralPartialEq for StackReq
Auto Trait Implementations§
impl Freeze for StackReq
impl RefUnwindSafe for StackReq
impl Send for StackReq
impl Sync for StackReq
impl Unpin for StackReq
impl UnwindSafe for StackReq
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