[Victoriafalls] Add file access to underlying memory.
This commit is contained in:
parent
8d3f77e648
commit
bbb44be96e
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue