Struct axgeom::Range
[−]
[src]
#[must_use]pub struct Range<T: Copy> { pub start: T, pub end: T, }
A 1d range. Internally represented as start and end. (not start and length) This means that subdivision does not result in any floating point calculations. There is no protection against "degenerate" Ranges where start>end.
Fields
start: T
end: T
Methods
impl<T: Copy + Debug + Ord> Range<T>
[src]
fn left_or_right_or_contain(&self, pos: &T) -> Ordering
[src]
If the pos is to the left of the range, return less. If the pos is to the right of the range, return greater. If the pos intersects with the range, return equal.
fn grow_to_fit(&mut self, b: &Range<T>)
[src]
fn contains(&self, pos: T) -> bool
[src]
Returns true if the point is inside of the range or on top of.
fn contains_range(&self, val: &Range<T>) -> bool
[src]
Returns true if self contains the specified range.
fn get_intersection(&self, val: &Range<T>) -> Option<Range<T>>
[src]
Creates a range that represents the intersection range.
fn intersects(&self, val: &Range<T>) -> bool
[src]
Returns true if two ranges intersect.
impl Range<f32>
[src]
fn len(&self) -> f32
[src]
fn grow(&mut self, val: f32) -> &mut Range<f32>
[src]
Grow in both ends by the specified value.
fn midpoint(&self) -> f32
[src]
impl<T: Copy + Debug> Range<T>
[src]
Trait Implementations
impl<T: Copy + Copy> Copy for Range<T>
[src]
impl<T: Clone + Copy> Clone for Range<T>
[src]
fn clone(&self) -> Range<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more