1use crate::nativepointer::NativePointer;
2use crate::plumbing;
3
4pub struct RangeDetails {
5 pub base: NativePointer,
6 pub size: usize,
7 pub protection: String,
8 pub file: Option<FileMapping>,
9}
10
11impl From<plumbing::range::RangeDetails> for RangeDetails {
12 fn from(m: plumbing::range::RangeDetails) -> Self {
13 RangeDetails {
14 base: m.base(),
15 size: m.size(),
16 protection: m.protection(),
17 file: m.file().map(|s| FileMapping::from(s)),
18 }
19 }
20}
21
22pub struct FileMapping {
23 pub path: String,
24 pub offset: usize,
25 pub size: usize,
26}
27
28impl From<plumbing::range::FileMapping> for FileMapping {
29 fn from(m: plumbing::range::FileMapping) -> Self {
30 FileMapping {
31 path: m.path(),
32 offset: m.offset(),
33 size: m.size(),
34 }
35 }
36}