MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / new

Method new

src/fs/inotify.rs:107–121  ·  view source on GitHub ↗

Create a new iterator from the given file descriptor and buffer.

(fd: Fd, buf: &'buf mut [MaybeUninit<u8>])

Source from the content-addressed store, hash-verified

105impl<'buf, Fd: AsFd> Reader<'buf, Fd> {
106 /// Create a new iterator from the given file descriptor and buffer.
107 pub fn new(fd: Fd, buf: &'buf mut [MaybeUninit<u8>]) -> Self {
108 Self {
109 fd,
110 buf: {
111 let offset = buf.as_ptr().align_offset(align_of::<inotify_event>());
112 if offset < buf.len() {
113 &mut buf[offset..]
114 } else {
115 &mut []
116 }
117 },
118 initialized: 0,
119 offset: 0,
120 }
121 }
122}
123
124/// An inotify event.

Callers

nothing calls this directly

Calls 2

as_ptrMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected