[−][src]Trait sunrise_libuser::fs::IFileAsync
Represent a file in a filesystem.
Required methods
fn read<'a>(
&'a mut self,
work_queue: WorkQueue<'static>,
option: u32,
offset: u64,
size: u64,
out_buf: &'a mut [u8]
) -> FutureObj<'a, Result<u64, Error>>
&'a mut self,
work_queue: WorkQueue<'static>,
option: u32,
offset: u64,
size: u64,
out_buf: &'a mut [u8]
) -> FutureObj<'a, Result<u64, Error>>
Read the content of a file at a given offset
in out_buf
. option
should be set to 0.
fn write<'a>(
&'a mut self,
work_queue: WorkQueue<'static>,
option: u32,
offset: u64,
size: u64,
in_buf: &'a [u8]
) -> FutureObj<'a, Result<(), Error>>
&'a mut self,
work_queue: WorkQueue<'static>,
option: u32,
offset: u64,
size: u64,
in_buf: &'a [u8]
) -> FutureObj<'a, Result<(), Error>>
Write the content given in_buf
at the given offset
in the file.
If the file is too small to hold the data and the appendable flag is set, it will resize the file and append the data.
If the file is too small to hold the data and the appendable flag isn't set, this will return a FileSystemError::NoSpaceLeft.
option
should be set to 0.
fn flush<'a>(
&'a mut self,
work_queue: WorkQueue<'static>
) -> FutureObj<'a, Result<(), Error>>
&'a mut self,
work_queue: WorkQueue<'static>
) -> FutureObj<'a, Result<(), Error>>
Flush any data not written on the filesystem.
fn set_size<'a>(
&'a mut self,
work_queue: WorkQueue<'static>,
size: u64
) -> FutureObj<'a, Result<(), Error>>
&'a mut self,
work_queue: WorkQueue<'static>,
size: u64
) -> FutureObj<'a, Result<(), Error>>
Resize the file with the given size
.
If the file isn't open with the appendable flag, it will not be extendable and will return a FileSystemError::NoSpaceLeft.
fn get_size<'a>(
&'a mut self,
work_queue: WorkQueue<'static>
) -> FutureObj<'a, Result<u64, Error>>
&'a mut self,
work_queue: WorkQueue<'static>
) -> FutureObj<'a, Result<u64, Error>>
Return the current file size.
Provided methods
fn dispatch<'a>(
&'a mut self,
work_queue: WorkQueue<'static>,
cmdid: u32,
buf: &'a mut [u8]
) -> FutureObj<Result<(), Error>>
&'a mut self,
work_queue: WorkQueue<'static>,
cmdid: u32,
buf: &'a mut [u8]
) -> FutureObj<Result<(), Error>>
Handle an incoming IPC request.