pub struct FileHandle {
pub inode: Option<Arc<Inode>>,
pub read: bool,
pub write: bool,
pub offset: Cell<usize>,
}Expand description
Cached file metadata in memory
Fields§
§inode: Option<Arc<Inode>>FileSystem Inode
read: boolOpen options: able to read
write: boolOpen options: able to write
offset: Cell<usize>Current offset
Implementations§
Source§impl FileHandle
impl FileHandle
Sourcepub fn read(&self, buf: UserBuffer) -> isize
pub fn read(&self, buf: UserBuffer) -> isize
从文件读取数据到用户缓冲区。
Sourcepub fn write(&self, buf: UserBuffer) -> isize
pub fn write(&self, buf: UserBuffer) -> isize
将用户缓冲区数据写入文件。
Trait Implementations§
Source§impl Clone for FileHandle
impl Clone for FileHandle
Source§fn clone(&self) -> FileHandle
fn clone(&self) -> FileHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for FileHandle
impl !RefUnwindSafe for FileHandle
impl Send for FileHandle
impl !Sync for FileHandle
impl Unpin for FileHandle
impl UnsafeUnpin for FileHandle
impl !UnwindSafe for FileHandle
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