Getter for Grant region, remove set_mapped, and make region_mut private

This commit is contained in:
Jeremy Soller
2021-11-30 20:06:45 -07:00
parent 4f259e3589
commit 77b8215a66

View File

@@ -298,9 +298,13 @@ impl Grant {
self.owned
}
pub fn region(&self) -> &Region {
&self.region
}
/// Get a mutable reference to the region. This is unsafe, because a bad
/// region could lead to the wrong addresses being unmapped.
pub unsafe fn region_mut(&mut self) -> &mut Region {
unsafe fn region_mut(&mut self) -> &mut Region {
&mut self.region
}
@@ -482,10 +486,6 @@ impl Grant {
self.flags
}
pub unsafe fn set_mapped(&mut self, mapped: bool) {
self.mapped = mapped;
}
pub fn unmap(mut self) {
assert!(self.mapped);