Skip to main content

DirEntries

Struct DirEntries 

Source
pub struct DirEntries<'a> { /* private fields */ }
Expand description

Represents a collection of entries in a directory.

This type provides access to the files and subdirectories within a directory. It can be iterated over or queried by name.

Implementations§

Source§

impl<'a> DirEntries<'a>

Source

pub fn len(&self) -> usize

Returns the number of entries in the directory.

Source

pub fn is_empty(&self) -> bool

Returns true if the directory is empty.

Source

pub fn get(&self, name: &[u8]) -> Option<&DirEntry<'a>>

Returns a reference to the entry with the given name.

Source

pub fn remove(&mut self, name: &[u8]) -> Option<DirEntry<'a>>

Removes and returns the entry with the given name.

Source

pub fn iter(&self) -> DirEntriesIter<'_, 'a>

Returns an iterator over the entries.

Source

pub fn names(&self) -> impl Iterator<Item = &[u8]>

Returns an iterator over the entry names.

Trait Implementations§

Source§

impl<'a> Debug for DirEntries<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'b, 'a> IntoIterator for &'b DirEntries<'a>

Source§

type Item = (&'b [u8], &'b DirEntry<'a>)

The type of the elements being iterated over.
Source§

type IntoIter = DirEntriesIter<'b, 'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for DirEntries<'a>

Source§

type Item = (Vec<u8>, DirEntry<'a>)

The type of the elements being iterated over.
Source§

type IntoIter = DirEntriesOwnedIter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DirEntries<'a>

§

impl<'a> !RefUnwindSafe for DirEntries<'a>

§

impl<'a> Send for DirEntries<'a>

§

impl<'a> Sync for DirEntries<'a>

§

impl<'a> Unpin for DirEntries<'a>

§

impl<'a> !UnwindSafe for DirEntries<'a>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.