1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::memory_address::MemoryAddress;
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub struct MemoryRange {
pub from: MemoryAddress,
pub to: MemoryAddress,
}
impl MemoryRange {
#[inline(always)]
pub const fn new(from: MemoryAddress, to: MemoryAddress) -> Self {
Self { from, to }
}
#[inline(always)]
pub(crate) fn contains(&self, from_memory_address: MemoryAddress) -> bool {
from_memory_address >= self.from && from_memory_address < self.to
}
}