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
}
}