pub struct IntervalStepwise {
pub min: Interval,
pub max: Interval,
pub step: Interval,
}Expand description
Stepwise interval description (min/max/step).
§Example
use std::num::NonZeroU32;
use styx_core::prelude::{Interval, IntervalStepwise};
let make = |n, d| Interval {
numerator: NonZeroU32::new(n).unwrap(),
denominator: NonZeroU32::new(d).unwrap(),
};
let stepwise = IntervalStepwise {
min: make(1, 60),
max: make(1, 30),
step: make(1, 30),
};
assert!(stepwise.contains(make(1, 30)));Fields§
§min: Interval§max: Interval§step: IntervalImplementations§
Trait Implementations§
Source§impl Clone for IntervalStepwise
impl Clone for IntervalStepwise
Source§fn clone(&self) -> IntervalStepwise
fn clone(&self) -> IntervalStepwise
Returns a duplicate 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 IntervalStepwise
impl Debug for IntervalStepwise
Source§impl PartialEq for IntervalStepwise
impl PartialEq for IntervalStepwise
impl Copy for IntervalStepwise
impl Eq for IntervalStepwise
impl StructuralPartialEq for IntervalStepwise
Auto Trait Implementations§
impl Freeze for IntervalStepwise
impl RefUnwindSafe for IntervalStepwise
impl Send for IntervalStepwise
impl Sync for IntervalStepwise
impl Unpin for IntervalStepwise
impl UnwindSafe for IntervalStepwise
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> 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