File

Struct File 

Source
#[repr(C)]
pub struct File { /* private fields */ }
Expand description

A file loaded by the bootloader. Returned from ExecutableFileRequest and ModuleRequest.

Implementations§

Source§

impl File

Source

pub fn revision(&self) -> u64

Get the revision of the file. Currently, this is always 0.

Source

pub fn addr(&self) -> *mut u8

The base address of the file. Note that this is not necessarily a pointer to executable code. It simply points to the raw file.

Source

pub fn size(&self) -> u64

The size of the file, in bytes.

Source

pub fn path(&self) -> &CStr

The path of the file. This is the path that was passed to the bootloader in either the configuration file or the internal_modules field of the ModuleRequest.

Source

pub fn string(&self) -> &CStr

The string associated with this file. This is the command line that was passed to the bootloader in either the configuration file or the internal_modules field of the ModuleRequest.

It is returned as a raw byte slice, and the encoding is unspecified.

Source

pub fn cmdline(&self) -> &[u8]

👎Deprecated since 0.4.0: please use File::string instead

The command line of the file. This is the command line that was passed to the bootloader in either the configuration file or the internal_modules field of the ModuleRequest.

It is returned as a raw byte slice, and the encoding is unspecified.

Source

pub fn media_type(&self) -> MediaType

The media type of the file. See MediaType for more information.

Source

pub fn tftp_ip(&self) -> Option<NonZeroU32>

The IP address of the TFTP server, if the file was loaded from a TFTP.

Source

pub fn tftp_port(&self) -> Option<NonZeroU32>

The port of the TFTP server, if the file was loaded from a TFTP.

Source

pub fn partition_idx(&self) -> Option<NonZeroU32>

The partition index of the file, if the file was loaded from a partition.

Source

pub fn mbr_disk_id(&self) -> Option<NonZeroU32>

The MBR disk ID of the file, if the file was loaded from an MBR disk.

Source

pub fn gpt_disk_id(&self) -> Option<Uuid>

The GPT disk UUID of the file, if the file was loaded from a GPT disk.

Source

pub fn gpt_partition_id(&self) -> Option<Uuid>

The GPT partition UUID of the file, if the file was loaded from a GPT partition.

Source

pub fn partition_uuid(&self) -> Option<Uuid>

The partition UUID of the file, if the file was loaded from a partition with a UUID.

Auto Trait Implementations§

§

impl Freeze for File

§

impl RefUnwindSafe for File

§

impl !Send for File

§

impl !Sync for File

§

impl Unpin for File

§

impl UnwindSafe for File

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, 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.