Lines Matching defs:Dir
24 /// The file descriptor continues to be owned by the `Dir`, so callers must not keep a `RawFd`
25 /// after the `Dir` is dropped.
32 pub struct Dir(ptr::NonNull<libc::DIR>);
34 impl Dir {
42 Dir::from_fd(fd)
53 Dir::from_fd(fd)
59 Dir::from_fd(fd.into_raw_fd())
72 Ok(Dir(d))
81 // `Dir` is not `Sync`. With the current implementation, it could be, but according to
86 // `Dir` is safe to pass from one thread to another, as it's not reference-counted.
87 unsafe impl Send for Dir {}
89 impl AsRawFd for Dir {
95 impl Drop for Dir {
104 fn next(dir: &mut Dir) -> Option<Result<Entry>> {
128 /// Return type of [`Dir::iter`].
130 pub struct Iter<'d>(&'d mut Dir);
146 /// The return type of [Dir::into_iter]
148 pub struct OwningIter(Dir);
166 impl IntoIterator for Dir {
171 /// `Dir`. The `Dir` cannot be used after calling this. This can be useful
172 /// when you have a function that both creates a `Dir` instance and returns
178 /// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode};
182 /// let d = Dir::open(dirname, OFlag::O_DIRECTORY, Mode::S_IXUSR).unwrap();