pub struct FileOpen { /* private fields */ }
Expand description
INTERNAL TYPE: do not use directly.
Use FileRead
, FileWrite
or FileEdit
instead.
Implementations§
Source§impl FileOpen
impl FileOpen
Sourcepub fn open<P: AsRef<Path>>(path: P, options: OpenOptions) -> Result<FileOpen>
pub fn open<P: AsRef<Path>>(path: P, options: OpenOptions) -> Result<FileOpen>
Open the file with the given OpenOptions
.
Sourcepub fn open_abs<P: Into<PathAbs>>(
path: P,
options: OpenOptions,
) -> Result<FileOpen>
pub fn open_abs<P: Into<PathAbs>>( path: P, options: OpenOptions, ) -> Result<FileOpen>
Shortcut to open the file if the path is already absolute.
Typically you should use PathFile::open
instead (i.e. file.open(options)
or
file.read()
).
Sourcepub fn metadata(&self) -> Result<Metadata>
pub fn metadata(&self) -> Result<Metadata>
Queries metadata about the underlying file.
This function is identical to std::fs::File::metadata except it has error messages which include the action and the path.
Sourcepub fn try_clone(&self) -> Result<FileOpen>
pub fn try_clone(&self) -> Result<FileOpen>
Creates a new independently owned handle to the underlying file.
This function is identical to std::fs::File::try_clone except it has error
messages which include the action and the path and it returns a FileOpen
object.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileOpen
impl RefUnwindSafe for FileOpen
impl Send for FileOpen
impl Sync for FileOpen
impl Unpin for FileOpen
impl UnwindSafe for FileOpen
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