Struct memrange::Range [] [src]

pub struct Range {
    pub min: u64,
    pub max: u64,
}

Fields

Methods

impl Range
[src]

use memrange::{range, Range};
assert_eq!(range(0,5).each_slice(2).collect::<Vec<Range>>(), vec![range(0,1), range(2,3), range(4,5)])

use memrange::{range, Range};
use std::cmp::Ordering;
assert_eq!(range(  0,5).intersection_cmp(&range(6,100)), Ordering::Less);
assert_eq!(range(  0,5).intersection_cmp(&range(5,100)), Ordering::Equal);
assert_eq!(range(5,100).intersection_cmp(&range(1,2)),   Ordering::Greater);

returns Equal if self and b are intersecting, the usual comparision otherwise

Trait Implementations

impl Debug for Range
[src]

Formats the value using the given formatter.

impl Copy for Range
[src]

impl Clone for Range
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Range
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Range
[src]

impl PartialOrd for Range
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for Range
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Encodable for Range
[src]

Serialize a value using an Encoder.

impl Decodable for Range
[src]

Deserialize a value using a Decoder.

impl Ord for Range
[src]

This method returns an Ordering between self and other. Read more