pub struct RamfsScheme { /* private fields */ }Expand description
Kernel-resident RAM filesystem implementing the Scheme trait.
Implementations§
Source§impl RamfsScheme
impl RamfsScheme
Sourcepub fn ensure_dir(&self, path: &str)
pub fn ensure_dir(&self, path: &str)
Ensure that path (relative to mount root) exists as a directory.
Silently succeeds if the directory already exists.
Sourcepub fn insert_file(&self, name: &str, content: &[u8])
pub fn insert_file(&self, name: &str, content: &[u8])
Insert a read-only file into the root.
Convenience helper used during vfs::init() to pre-populate files.
Trait Implementations§
Source§impl Scheme for RamfsScheme
impl Scheme for RamfsScheme
Source§fn open(&self, path: &str, flags: OpenFlags) -> Result<OpenResult, SyscallError>
fn open(&self, path: &str, flags: OpenFlags) -> Result<OpenResult, SyscallError>
Performs the open operation.
Source§fn read(
&self,
file_id: u64,
offset: u64,
buf: &mut [u8],
) -> Result<usize, SyscallError>
fn read( &self, file_id: u64, offset: u64, buf: &mut [u8], ) -> Result<usize, SyscallError>
Performs the read operation.
Source§fn write(
&self,
file_id: u64,
offset: u64,
buf: &[u8],
) -> Result<usize, SyscallError>
fn write( &self, file_id: u64, offset: u64, buf: &[u8], ) -> Result<usize, SyscallError>
Performs the write operation.
Source§fn truncate(&self, file_id: u64, new_size: u64) -> Result<(), SyscallError>
fn truncate(&self, file_id: u64, new_size: u64) -> Result<(), SyscallError>
Performs the truncate operation.
Source§fn create_file(&self, path: &str, mode: u32) -> Result<OpenResult, SyscallError>
fn create_file(&self, path: &str, mode: u32) -> Result<OpenResult, SyscallError>
Creates file.
Source§fn create_directory(
&self,
path: &str,
mode: u32,
) -> Result<OpenResult, SyscallError>
fn create_directory( &self, path: &str, mode: u32, ) -> Result<OpenResult, SyscallError>
Creates directory.
Source§fn readdir(&self, file_id: u64) -> Result<Vec<DirEntry>, SyscallError>
fn readdir(&self, file_id: u64) -> Result<Vec<DirEntry>, SyscallError>
Performs the readdir operation.
Source§fn rename(&self, old_path: &str, new_path: &str) -> Result<(), SyscallError>
fn rename(&self, old_path: &str, new_path: &str) -> Result<(), SyscallError>
Performs the rename operation.
Source§fn chmod(&self, path: &str, mode: u32) -> Result<(), SyscallError>
fn chmod(&self, path: &str, mode: u32) -> Result<(), SyscallError>
Performs the chmod operation.
Source§fn fchmod(&self, file_id: u64, mode: u32) -> Result<(), SyscallError>
fn fchmod(&self, file_id: u64, mode: u32) -> Result<(), SyscallError>
Performs the fchmod operation.
Source§fn link(&self, old_path: &str, new_path: &str) -> Result<(), SyscallError>
fn link(&self, old_path: &str, new_path: &str) -> Result<(), SyscallError>
Performs the link operation.
Source§fn symlink(&self, target: &str, link_path: &str) -> Result<(), SyscallError>
fn symlink(&self, target: &str, link_path: &str) -> Result<(), SyscallError>
Performs the symlink operation.
Auto Trait Implementations§
impl !Freeze for RamfsScheme
impl !RefUnwindSafe for RamfsScheme
impl Send for RamfsScheme
impl Sync for RamfsScheme
impl Unpin for RamfsScheme
impl UnsafeUnpin for RamfsScheme
impl UnwindSafe for RamfsScheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more