Struct proc_maps::linux_maps::MapRange
source · pub struct MapRange {
pub offset: usize,
pub dev: String,
pub flags: String,
pub inode: usize,
/* private fields */
}
Expand description
A struct representing a single virtual memory region.
While this structure is only for Linux, the macOS, Windows, and FreeBSD variants have identical exposed methods
Fields§
§offset: usize
§dev: String
§flags: String
§inode: usize
Implementations§
source§impl MapRange
impl MapRange
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Returns the size of this MapRange in bytes
Examples found in repository?
examples/print_maps.rs (line 18)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
fn main() {
let args: Vec<String> = std::env::args().collect();
let pid = if args.len() > 1 {
args[1].parse().expect("invalid pid")
} else {
panic!("Usage: print_maps PID");
};
let maps = proc_maps::get_process_maps(pid).expect("failed to get proc maps");
for map in maps {
println!(
"Filename {:?} Address {} Size {}",
map.filename(),
map.start(),
map.size()
);
}
}
sourcepub fn start(&self) -> usize
pub fn start(&self) -> usize
Returns the address this MapRange starts at
Examples found in repository?
examples/print_maps.rs (line 17)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
fn main() {
let args: Vec<String> = std::env::args().collect();
let pid = if args.len() > 1 {
args[1].parse().expect("invalid pid")
} else {
panic!("Usage: print_maps PID");
};
let maps = proc_maps::get_process_maps(pid).expect("failed to get proc maps");
for map in maps {
println!(
"Filename {:?} Address {} Size {}",
map.filename(),
map.start(),
map.size()
);
}
}
sourcepub fn filename(&self) -> Option<&Path>
pub fn filename(&self) -> Option<&Path>
Returns the filename of the loaded module
Examples found in repository?
examples/print_maps.rs (line 16)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
fn main() {
let args: Vec<String> = std::env::args().collect();
let pid = if args.len() > 1 {
args[1].parse().expect("invalid pid")
} else {
panic!("Usage: print_maps PID");
};
let maps = proc_maps::get_process_maps(pid).expect("failed to get proc maps");
for map in maps {
println!(
"Filename {:?} Address {} Size {}",
map.filename(),
map.start(),
map.size()
);
}
}
Trait Implementations§
source§impl PartialEq<MapRange> for MapRange
impl PartialEq<MapRange> for MapRange
impl StructuralPartialEq for MapRange
Auto Trait Implementations§
impl RefUnwindSafe for MapRange
impl Send for MapRange
impl Sync for MapRange
impl Unpin for MapRange
impl UnwindSafe for MapRange
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more