[Victoriafalls] Add file access to underlying memory.

This commit is contained in:
Drew Galbraith 2024-08-18 12:26:15 -07:00
parent 8d3f77e648
commit bbb44be96e
1 changed files with 6 additions and 2 deletions

View File

@ -1,9 +1,9 @@
use crate::OpenFileRequest;
use alloc::string::ToString;
use mammoth::{cap::Capability, zion::ZError};
use mammoth::{cap::Capability, mem::MemoryRegion, zion::ZError};
pub struct File {
memory: mammoth::mem::MemoryRegion,
memory: MemoryRegion,
len: usize,
}
@ -23,4 +23,8 @@ impl File {
pub fn slice(&self) -> &[u8] {
&self.memory.slice()[..self.len]
}
pub fn memory(&self) -> &MemoryRegion {
&self.memory
}
}