diff --git a/src/shm/raw.rs b/src/shm/raw.rs index 690352649..138842071 100644 --- a/src/shm/raw.rs +++ b/src/shm/raw.rs @@ -10,7 +10,7 @@ use rustix::{ use std::{ fs::File, io, - os::unix::prelude::{AsFd, OwnedFd}, + os::unix::prelude::{AsFd, BorrowedFd, OwnedFd}, sync::Arc, time::{SystemTime, UNIX_EPOCH}, }; @@ -151,6 +151,12 @@ impl RawPool { } } +impl AsFd for RawPool { + fn as_fd(&self) -> BorrowedFd { + self.mem_file.as_fd() + } +} + impl io::Write for RawPool { fn write(&mut self, buf: &[u8]) -> io::Result { io::Write::write(&mut self.mem_file, buf)