pub struct ReadDir(/* private fields */);展开描述
实现§
Source§impl ReadDir
impl ReadDir
Sourcepub async fn next_entry(&mut self) -> Result<Option<DirEntry>>
pub async fn next_entry(&mut self) -> Result<Option<DirEntry>>
Sourcepub fn poll_next_entry(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Option<DirEntry>>>
pub fn poll_next_entry( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Option<DirEntry>>>
轮询流中的下一个目录条目。
此方法返回:
Poll::Pendingif the next directory entry is not yet available.Poll::Ready(Ok(Some(entry)))if the next directory entry is available.Poll::Ready(Ok(None))if there are no more directory entries in this stream.Poll::Ready(Err(err))if an IO error occurred while reading the next directory entry.
当方法返回 Poll::Pending 时,提供的
Context 中的 Waker 会被安排为在底层 IO 资源上
可获取下一个目录条目时收到唤醒。
请注意,在多次调用 poll_next_entry 时,只有
传递给最近一次调用的 Context 中的 Waker 会被安排
接收唤醒。
Trait 实现§
自动 Trait 实现§
impl Freeze for ReadDir
impl !RefUnwindSafe for ReadDir
impl Send for ReadDir
impl Sync for ReadDir
impl Unpin for ReadDir
impl UnsafeUnpin for ReadDir
impl !UnwindSafe for ReadDir
Blanket 实现§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 更多信息