pub struct Constraint {
pub size: u64,
pub min: u64,
pub max: u64,
pub align: u64,
pub policy: AllocPolicy,
}
Expand description
Struct to declare resource allocation constraints.
Fields§
§size: u64
Size of resource to allocate.
min: u64
Lower boundary for resource allocation.
max: u64
Upper boundary for resource allocation.
align: u64
Alignment for allocated resource.
policy: AllocPolicy
Policy for resource allocation.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn new<T>(size: T) -> Self
pub fn new<T>(size: T) -> Self
Create a new instance of Constraint
with default settings.
Sourcepub fn policy(self, policy: AllocPolicy) -> Self
pub fn policy(self, policy: AllocPolicy) -> Self
Set the resource allocation policy.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Constraint
impl Debug for Constraint
impl Copy for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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