//! Minimal memory-map wrapper.
//!
//! `Mmap::map` requires `unsafe` to dereference the raw pointer from the OS.
//! This module contains that unsafety in one place with a documented invariant.
//!
//! # Safety
//!
//! `Mmap::map` creates a memory mapping from a file descriptor. The OS manages
//! the mapping and will not allow access beyond the file bounds. The returned
//! `Mmap` is valid for the lifetime of the file descriptor — which must not be
//! closed while the mapping is alive. We immediately drop the `File` after
//! creating the mapping, relying on the OS's reference-counted mapping to keep
//! the data accessible.
use Mmap;
use File;
use io;
use Path;