pub unsafe trait MapFlags {
// Required method
fn get_mmap_flags(&self) -> c_int;
}
Expand description
Any type implementing this trait can be passed to MappedFile<T>
’s try_/new()
method to provide flags directly for mmap()
.
Usually, the enum Flags
should be used for this, but for HUGETLB configurations, or used-defined MAP_FIXED
usages, it can be used on other types.
This trait is also implemented on ()
, which will just return Flags::default()
’s implementation of it.
§Safety
This trait is marked unsafe
as invalid memory mapping configurations can cause invalid or undefined behaviour that is unknown to MappedFile<T>
.