pub fn new(wl_shm: wl::Main<WlShm>) -> Result<Self, nix::Error> {
        // TODO is this a good way to choose a filename? What should our retry strategy be?
        let name = format!("/druid-wl-{}", rand::random::<i32>());
        // Open the file we will use for shared memory.
        let fd = shm_open(
            name.as_str(),
            OFlag::O_RDWR | OFlag::O_EXCL | OFlag::O_CREAT,
            Mode::S_IRUSR | Mode::S_IWUSR,
        )?;

        // The memory is 0-sized until we resize it with `ftruncate`.
        let shm = Shm {
            inner: fd,
            size: 0,
            wl_shm,
        };
        Ok(shm)
    }
/// Create a new shared memory object. Will be empty until resized.
Create a new shared memory object. Will be empty until resized.
Create a new shared memory object . Will be empty until resized .
pub fn new(wl_shm: wl::Main<WlShm>) -> Result<Self, nix::Error> {
        // TODO is this a good way to choose a filename? What should our retry strategy be?
        let name = format!("/druid-wl-{}", rand::random::<i32>());
        // Open the file we will use for shared memory.
        let fd = shm_open(
            name.as_str(),
            OFlag::O_RDWR | OFlag::O_EXCL | OFlag::O_CREAT,
            Mode::S_IRUSR | Mode::S_IWUSR,
        )?;
        // The memory is 0-sized until we resize it with `ftruncate`.
        let shm = Shm {
            inner: fd,
            size: 0,
            wl_shm,
        };
        Ok(shm)
    }
pub fn new ( wl_shm : wl :: Main < WlShm > ) -> Result < Self , nix :: Error > { // TODO is this a good way to choose a filename? What should our retry strategy be? let name = format ! ( " " rand random i32 ( ) ) ; // Open the file we will use for shared memory. let fd = shm_open ( name . as_str ( ) , OFlag :: O_RDWR | OFlag :: O_EXCL | OFlag :: O_CREAT , Mode :: S_IRUSR | Mode :: S_IWUSR , ) ? ; // The memory is 0-sized until we resize it with `ftruncate`. let shm = Shm { inner : fd , size : 0 , wl_shm , } ; Ok ( shm ) }
Create a new shared memory object.
Create a new shared memory object .
wl_shm
wl::Main<WlShm>
wl_shm
wl::Main<WlShm>