Struct rect_iter::RectRange
[−]
[src]
pub struct RectRange<T: Num + PartialOrd> { /* fields omitted */ }
RectRange is rectangle representation using std::ops::Range
.
Diffrent from RangeIntoIterator
implementation and iter
method(with 'clone').
Methods
impl<T: Num + PartialOrd> RectRange<T>
[src]
pub fn new(lx: T, ly: T, ux: T, uy: T) -> Option<RectRange<T>>
[src]
pub fn zero_start(x: T, y: T) -> Option<RectRange<T>>
[src]
pub fn from_point<P: IntoTuple2<T>>(p: P) -> Option<RectRange<T>>
[src]
pub fn from_ranges(x: Range<T>, y: Range<T>) -> Option<RectRange<T>>
[src]
pub fn get_x(&self) -> &Range<T>
[src]
pub fn get_y(&self) -> &Range<T>
[src]
impl<T: Num + PartialOrd + Clone> RectRange<T>
[src]
pub fn cloned_x(&self) -> Range<T>
[src]
get x range
pub fn cloned_y(&self) -> Range<T>
[src]
get y range
pub fn slide<P: IntoTuple2<T>>(self, t: P) -> RectRange<T>
[src]
slide range by the given point
pub fn slide_start<P: IntoTuple2<T>>(self, t: P) -> RectRange<T>
[src]
slide start point without checking
pub fn slide_end<P: IntoTuple2<T>>(self, t: P) -> RectRange<T>
[src]
slide end point without checking
pub fn xlen(&self) -> T
[src]
the length in the x-axis deirection
pub fn ylen(&self) -> T
[src]
the length of in the y-axis deirection
pub fn intersects(&self, other: &RectRange<T>) -> bool
[src]
judges if 2 ranges have intersection
pub fn intersection(&self, other: &RectRange<T>) -> Option<RectRange<T>>
[src]
gets the intersection of 2 ranges
pub fn upper_left(&self) -> (T, T)
[src]
get the upper left corner(inclusive)
pub fn upper_right(&self) -> (T, T)
[src]
get the upper right corner(inclusive)
pub fn lower_left(&self) -> (T, T)
[src]
get the lower left corner(inclusive)
pub fn lower_right(&self) -> (T, T)
[src]
get the lower right corner(inclusive)
impl<T: Num + PartialOrd + Copy> RectRange<T>
[src]
pub fn from_rect<U>(rect: TypedRect<T, U>) -> Option<RectRange<T>>
[src]
pub fn to_rect<U>(&self) -> TypedRect<T, U>
[src]
pub fn from_corners<P: IntoTuple2<T>>(lu: P, rd: P) -> Option<RectRange<T>>
[src]
ⓘImportant traits for RectIter<T>pub fn iter(&self) -> RectIter<T>
[src]
pub fn scale(self, sc: T) -> RectRange<T>
[src]
impl<T: Num + PartialOrd + ToPrimitive + Copy> RectRange<T>
[src]
pub fn to_u8(self) -> Option<RectRange<u8>>
[src]
pub fn to_u16(self) -> Option<RectRange<u16>>
[src]
pub fn to_u32(self) -> Option<RectRange<u32>>
[src]
pub fn to_u64(self) -> Option<RectRange<u64>>
[src]
pub fn to_i8(self) -> Option<RectRange<i8>>
[src]
pub fn to_i16(self) -> Option<RectRange<i16>>
[src]
pub fn to_i32(self) -> Option<RectRange<i32>>
[src]
pub fn to_i64(self) -> Option<RectRange<i64>>
[src]
pub fn to_usize(self) -> Option<RectRange<usize>>
[src]
impl<T: Num + PartialOrd + Copy + FromPrimitive + ToPrimitive> RectRange<T>
[src]
pub fn len(&self) -> usize
[src]
returns self.xlen * self.ylen
as usize
pub fn nth(&self, n: usize) -> Option<(T, T)>
[src]
return 'nth' element same as RectIter::nth, but much faster(O(1))
Trait Implementations
impl<T: Clone + Num + PartialOrd> Clone for RectRange<T>
[src]
fn clone(&self) -> RectRange<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
impl<T: Debug + Num + PartialOrd> Debug for RectRange<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: PartialEq + Num + PartialOrd> PartialEq for RectRange<T>
[src]
fn eq(&self, __arg_0: &RectRange<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RectRange<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq + Num + PartialOrd> Eq for RectRange<T>
[src]
impl<T: Hash + Num + PartialOrd> Hash for RectRange<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more