pub fn open(path: &Path, initial_size: u64) -> Self {

        let file = FlatFile::open_or_create(path, initial_size);

        let mut map = memmap::Mmap::open(&file, memmap::Protection::ReadWrite)
            .expect("Failed to open memory map");

        let ptr = map.mut_ptr();

        let write_ptr = unsafe { mem::transmute(ptr.offset(WRITEPOS_OFFSET)) };

        FlatFile {
            file:      Some(file),
            map:       Some(map),
            ptr:       ptr,
            write_ptr: write_ptr
        }
    }
/// Opens the flatfile with the given path and loads the corresponding memory map
/// Atomically creates the file if needed with the given `initial_size`
Opens the flatfile with the given path and loads the corresponding memory map
Atomically creates the file if needed with the given `initial_size`
Opens the flatfile with the given path and loads the corresponding memory map Atomically creates the file if needed with the given ` initial_size `
pub fn open(path: &Path, initial_size: u64) -> Self {
        let file = FlatFile::open_or_create(path, initial_size);
        let mut map = memmap::Mmap::open(&file, memmap::Protection::ReadWrite)
            .expect("Failed to open memory map");
        let ptr = map.mut_ptr();
        let write_ptr = unsafe { mem::transmute(ptr.offset(WRITEPOS_OFFSET)) };
        FlatFile {
            file:      Some(file),
            map:       Some(map),
            ptr:       ptr,
            write_ptr: write_ptr
        }
    }
pub fn open ( path : & Path , initial_size : u64 ) -> Self { let file = FlatFile :: open_or_create ( path , initial_size ) ; let mut map = memmap :: Mmap :: open ( & file , memmap :: Protection :: ReadWrite ) . expect ( " " ) ; let ptr = map . mut_ptr ( ) ; let write_ptr = unsafe { mem :: transmute ( ptr . offset ( WRITEPOS_OFFSET ) ) } ; FlatFile { file : Some ( file ) , map : Some ( map ) , ptr : ptr , write_ptr : write_ptr } }
Opens the flatfile with the given path and loads the corresponding memory map
Atomically creates the file if needed with the given `initial_size`
Opens the flatfile with the given path and loads the corresponding memory map Atomically creates the file if needed with the given ` initial_size `
path
&Path
initial_size
u64
path
&Path
initial_size
u64