pub struct ListSizeConstraint { /* private fields */ }Expand description
A constraint on a list size
The list must be composed of a number n of groups of size group_size which means list size
must be a multiple of group_size.
Moreover, n must be:
- bigger or equal to
min_inclusive_group_count - smaller of equal to
max_inclusive_group_count
Implementations§
Source§impl ListSizeConstraint
impl ListSizeConstraint
pub fn exact_size(size: usize) -> Self
pub fn try_size_in_range( min_inclusive: usize, max_inclusive: usize, ) -> Result<Self, String>
pub fn try_size_of_group_in_range( group_size: usize, min_inclusive_group_count: usize, max_inclusive_group_count: usize, ) -> Result<Self, String>
pub fn multiply_group_size(&self, group_size_multiplier: usize) -> Self
pub fn is_valid(&self, size: usize) -> bool
Trait Implementations§
Source§impl Clone for ListSizeConstraint
impl Clone for ListSizeConstraint
Source§fn clone(&self) -> ListSizeConstraint
fn clone(&self) -> ListSizeConstraint
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 moreimpl Copy for ListSizeConstraint
Auto Trait Implementations§
impl Freeze for ListSizeConstraint
impl RefUnwindSafe for ListSizeConstraint
impl Send for ListSizeConstraint
impl Sync for ListSizeConstraint
impl Unpin for ListSizeConstraint
impl UnwindSafe for ListSizeConstraint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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