Browse Source

Implement `RawFile::from_raw_fd()`

stratact 6 years ago
parent
commit
bb9d0e4aa1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/platform/src/rawfile.rs

+ 4 - 0
src/platform/src/rawfile.rs

@@ -25,6 +25,10 @@ impl RawFile {
     pub fn into_raw_fd(self) -> usize {
         self.0
     }
+
+    pub fn from_raw_fd(fd: usize) -> Self {
+        RawFile(fd)
+    }
 }
 
 impl Drop for RawFile {