Skip to content

Commit

Permalink
Allow converting Mmap and MmapMut into MmapRaw.
Browse files Browse the repository at this point in the history
  • Loading branch information
swlynch99 authored Feb 14, 2023
1 parent 9d5272a commit 9468f17
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,18 @@ impl fmt::Debug for MmapRaw {
}
}

impl From<Mmap> for MmapRaw {
fn from(value: Mmap) -> Self {
Self { inner: value.inner }
}
}

impl From<MmapMut> for MmapRaw {
fn from(value: MmapMut) -> Self {
Self { inner: value.inner }
}
}

/// A handle to a mutable memory mapped buffer.
///
/// A file-backed `MmapMut` buffer may be used to read from or write to a file. An anonymous
Expand Down

0 comments on commit 9468f17

Please sign in to comment.