Struct uefi::proto::media::file::Directory[][src]

#[repr(transparent)]
pub struct Directory(_);
Expand description

A FileHandle that is also a directory.

Use File::into_type or Directory::new to create a Directory. In addition to supporting the normal File operations, Directory supports iterating over its contained files.

Implementations

impl Directory[src]

pub unsafe fn new(handle: FileHandle) -> Self[src]

Coverts a FileHandle into a Directory without checking the file type.

Safety

This function should only be called on files which ARE directories, doing otherwise is unsafe.

pub fn read_entry<'buf>(
    &mut self,
    buffer: &'buf mut [u8]
) -> Result<Option<&'buf mut FileInfo>, Option<usize>>
[src]

Read the next directory entry

Try to read the next directory entry into buffer. If the buffer is too small, report the required buffer size as part of the error. If there are no more directory entries, return an empty optional.

The input buffer must be correctly aligned for a FileInfo. You can query the required alignment through the Align trait (<FileInfo as Align>::alignment()).

Arguments

  • buffer The target buffer of the read operation

Errors

  • uefi::Status::NO_MEDIA The device has no media
  • uefi::Status::DEVICE_ERROR The device reported an error, the file was deleted, or the end of the file was reached before the read().
  • uefi::Status::VOLUME_CORRUPTED The filesystem structures are corrupted
  • uefi::Status::BUFFER_TOO_SMALL The buffer is too small to hold a directory entry, the required buffer size is provided into the error.

pub fn reset_entry_readout(&mut self) -> Result[src]

Start over the process of enumerating directory entries

Trait Implementations

impl File for Directory[src]

fn handle(&mut self) -> &mut FileHandle[src]

fn open(
    &mut self,
    filename: &str,
    open_mode: FileMode,
    attributes: FileAttribute
) -> Result<FileHandle>
[src]

Try to open a file relative to this file. Read more

fn close(self)[src]

Close this file handle. Same as dropping this structure.

fn delete(self) -> Result[src]

Closes and deletes this file Read more

fn get_info<'buf, Info: FileProtocolInfo + ?Sized>(
    &mut self,
    buffer: &'buf mut [u8]
) -> Result<&'buf mut Info, Option<usize>>
[src]

Queries some information about a file Read more

fn set_info<Info: FileProtocolInfo + ?Sized>(&mut self, info: &Info) -> Result[src]

Sets some information about a file Read more

fn flush(&mut self) -> Result[src]

Flushes all modified data associated with the file handle to the device Read more

Auto Trait Implementations

impl !Send for Directory

impl !Sync for Directory

impl Unpin for Directory

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.