SimpleMemoryFileSystem

Struct SimpleMemoryFileSystem 

Source
pub struct SimpleMemoryFileSystem {
    files: &'static [FileEntry],
}
Expand description

简单内存文件系统的主要结构,包含所有静态文件条目。

Fields§

§files: &'static [FileEntry]

Implementations§

Source§

impl SimpleMemoryFileSystem

Source

pub const fn init() -> Self

§函数:init

初始化内存文件系统。

Source

pub fn lookup(&self, name: &str) -> Option<&'static [u8]>

§函数:lookup

根据文件名查找文件的内容切片。

@param name - 要查找的文件名。 @returns - 如果找到,返回文件的内容切片;否则返回 None。

Source

pub fn list_all(&self) -> Vec<String>

§函数:list_all

获取所有文件的名称列表。

Source

pub fn load_elf(&self, name: &str) -> Option<&'static [u8]>

§辅助函数:load_elf

这是供进程创建使用的主要接口。

@param name - ELF 文件名。 @returns - ELF 二进制数据的字节切片。

Auto Trait Implementations§

§

impl Freeze for SimpleMemoryFileSystem

§

impl RefUnwindSafe for SimpleMemoryFileSystem

§

impl Send for SimpleMemoryFileSystem

§

impl Sync for SimpleMemoryFileSystem

§

impl Unpin for SimpleMemoryFileSystem

§

impl UnwindSafe for SimpleMemoryFileSystem

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.