pub fn open(path: &str) -> Result<Self> {
        let file = OpenOptions::new().read(true).write(true).open(path)?;
        let map = unsafe { MmapMut::map_mut(&file)? };

        let buffer = Buffer::try_new(path, map, None)?;

        if buffer.header().flags.load(Relaxed) != crate::flags() {
            return Err(Error::IncompatibleRingBuffer);
        }

        Ok(Self(View::try_new(Arc::new(UnsafeCell::new(buffer)))?))
    }
/// Creates a new [`SharedRingBuffer`](struct.SharedRingBuffer.html) backed by a file with the specified name.
///
/// The file must already exist and have been initialized by a call to
/// [`SharedRingBuffer::create`](struct.SharedRingBuffer.html#method.create) or
/// [`SharedRingBuffer::create_temp`](struct.SharedRingBuffer.html#method.create_temp).
Creates a new [`SharedRingBuffer`](struct.SharedRingBuffer.html) backed by a file with the specified name.
Creates a new [ ` SharedRingBuffer ` ] ( struct . SharedRingBuffer . html ) backed by a file with the specified name .
pub fn open(path: &str) -> Result<Self> {
        let file = OpenOptions::new().read(true).write(true).open(path)?;
        let map = unsafe { MmapMut::map_mut(&file)? };
        let buffer = Buffer::try_new(path, map, None)?;
        if buffer.header().flags.load(Relaxed) != crate::flags() {
            return Err(Error::IncompatibleRingBuffer);
        }
        Ok(Self(View::try_new(Arc::new(UnsafeCell::new(buffer)))?))
    }
pub fn open ( path : & str ) -> Result < Self > { let file = OpenOptions :: new ( ) . read ( true ) . write ( true ) . open ( path ) ? ; let map = unsafe { MmapMut :: map_mut ( & file ) ? } ; let buffer = Buffer :: try_new ( path , map , None ) ? ; if buffer . header ( ) . flags . load ( Relaxed ) != crate :: flags ( ) { return Err ( Error :: IncompatibleRingBuffer ) ; } Ok ( Self ( View :: try_new ( Arc :: new ( UnsafeCell :: new ( buffer ) ) ) ? ) ) }
Creates a new [`SharedRingBuffer`](struct.SharedRingBuffer.html) backed by a file with the specified name.
Creates a new [ ` SharedRingBuffer ` ] ( struct . SharedRingBuffer . html ) backed by a file with the specified name .
path
&str
path
&str