MCPcopy Create free account
hub / github.com/emberian/evdev / _open

Method _open

src/raw_stream.rs:99–111  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

97 }
98
99 fn _open(path: &Path) -> io::Result<RawDevice> {
100 let mut options = OpenOptions::new();
101
102 // Try to load read/write, then fall back to read-only.
103 let fd: OwnedFd = options
104 .read(true)
105 .write(true)
106 .open(path)
107 .or_else(|_| options.write(false).open(path))?
108 .into();
109
110 Self::from_fd(fd)
111 }
112
113 /// Opens a device, given an already opened file descriptor
114 pub fn from_fd(fd: OwnedFd) -> io::Result<RawDevice> {

Callers

nothing calls this directly

Calls 1

openMethod · 0.45

Tested by

no test coverage detected