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

Method seek

src/backend/linux_raw/fs/dir.rs:112–125  ·  view source on GitHub ↗
(&mut self, offset: i64)

Source from the content-addressed store, hash-verified

110 #[doc(alias = "seekdir")]
111 #[inline]
112 pub fn seek(&mut self, offset: i64) -> io::Result<()> {
113 self.any_errors = false;
114 self.rewind = false;
115 self.pos = self.buf.len();
116 match io::retry_on_intr(|| {
117 crate::backend::fs::syscalls::_seek(self.fd.as_fd(), offset, SEEK_SET)
118 }) {
119 Ok(_) => Ok(()),
120 Err(err) => {
121 self.any_errors = true;
122 Err(err)
123 }
124 }
125 }
126
127 /// `readdir(self)`, where `None` means the end of the directory.
128 pub fn read(&mut self) -> Option<io::Result<DirEntry>> {

Callers

nothing calls this directly

Calls 4

retry_on_intrFunction · 0.85
_seekFunction · 0.85
lenMethod · 0.45
as_fdMethod · 0.45

Tested by

no test coverage detected