Skip to main content

DirStream

Struct DirStream 

Source
struct DirStream {
    read_dir: ReadDir,
    fd_num: i32,
    fd_id: FdId,
    special_entries: Vec<&'static str>,
    entry: Option<Pointer>,
}
Expand description

An open directory stream, tracked by DirTable.

Fields§

§read_dir: ReadDir

The directory reader on the host.

§fd_num: i32

An FD number for the same handle. Unix directory streams have an “underlying FD” that can be exposed; this is that FD. We also store the FD ID to catch cases where the FD was closed and a different one re-opened.

§fd_id: FdId§special_entries: Vec<&'static str>

The “special” entries that must still be yielded by the iterator. Used for . and ...

§entry: Option<Pointer>

The most recent entry returned by readdir(). Will be freed by the next call.

Implementations§

Source§

impl DirStream

Source

fn new(read_dir: ReadDir, fd_num: i32, fd_id: FdId) -> Self

Source

fn next_host_entry(&mut self) -> Option<Result<Either<DirEntry, &'static str>>>

Trait Implementations§

Source§

impl Debug for DirStream

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 88 bytes