derive some traits to be able to compare addresses

This commit is contained in:
Bruce Leidl 2019-09-11 15:28:37 -04:00
parent 9b2e7b8837
commit 784544ae2b

View File

@ -1,6 +1,6 @@
use std::fmt;
#[derive(Copy,Clone,Debug)]
#[derive(Copy,Clone,Debug,Ord,PartialOrd,Eq,PartialEq)]
pub struct AddressRange {
start: u64, // inclusive
end: u64, // exclusive
@ -66,6 +66,8 @@ impl AddressRange {
pub fn base(&self) -> u64 { self.start }
pub fn end(&self) -> u64 { self.end }
pub fn size(&self) -> usize { (self.end - self.start) as usize }
pub fn is_base2_sized(&self) -> bool {