#[repr(C)]pub struct File { /* private fields */ }Expand description
Represents an EFI_FILE_PROTOCOL.
Implementations§
Source§impl File
impl File
Sourcepub fn create<N: AsRef<EfiStr>>(
&self,
name: N,
attrs: FileAttributes,
) -> Result<Owned<Self>, FileCreateError>
pub fn create<N: AsRef<EfiStr>>( &self, name: N, attrs: FileAttributes, ) -> Result<Owned<Self>, FileCreateError>
Creates a file relative to the current file’s location.
This function will create a file if it does not exist, and will truncate it if it does. If
the filename starts with a \ the relative location is the root directory that the current
file resides on.
Sourcepub fn open<N: AsRef<EfiStr>>(
&self,
name: N,
modes: FileModes,
attrs: FileAttributes,
) -> Result<Owned<Self>, Status>
pub fn open<N: AsRef<EfiStr>>( &self, name: N, modes: FileModes, attrs: FileAttributes, ) -> Result<Owned<Self>, Status>
Opens a file relative to the current file’s location.
If the filename starts with a \ the relative location is the root directory that the
current file resides on.
Sourcepub fn write(&mut self, buf: &[u8]) -> Result<usize, Status>
pub fn write(&mut self, buf: &[u8]) -> Result<usize, Status>
Writes data to the file.
Partial writes only occur when there has been a data error during the write attempt (such as “file space full”).
Sourcepub fn set_position(&mut self, position: u64) -> Result<(), Status>
pub fn set_position(&mut self, position: u64) -> Result<(), Status>
Sets a file’s current position.
pub fn info(&self) -> Result<Box<FileInfo>, Status>
pub fn set_len(&mut self, len: u64) -> Result<(), FileSetLenError>
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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