Struct path_abs::open::FileOpen

source ·
pub struct FileOpen { /* private fields */ }
Expand description

INTERNAL TYPE: do not use directly.

Use FileRead, FileWrite or FileEdit instead.

Implementations§

source§

impl FileOpen

source

pub fn open<P: AsRef<Path>>(path: P, options: OpenOptions) -> Result<FileOpen>

Open the file with the given OpenOptions.

source

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()).

source

pub fn path(&self) -> &PathFile

Get the path associated with the open file.

source

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.

source

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§

source§

impl AsRef<File> for FileOpen

source§

fn as_ref(&self) -> &File

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<FileOpen> for FileEdit

source§

fn as_ref(&self) -> &FileOpen

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<FileOpen> for FileRead

source§

fn as_ref(&self) -> &FileOpen

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<FileOpen> for FileWrite

source§

fn as_ref(&self) -> &FileOpen

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> Borrow<File> for &'a FileOpen

source§

fn borrow(&self) -> &File

Immutably borrows from an owned value. Read more
source§

impl Borrow<File> for FileOpen

source§

fn borrow(&self) -> &File

Immutably borrows from an owned value. Read more
source§

impl<'a> Borrow<FileOpen> for &'a FileEdit

source§

fn borrow(&self) -> &FileOpen

Immutably borrows from an owned value. Read more
source§

impl<'a> Borrow<FileOpen> for &'a FileRead

source§

fn borrow(&self) -> &FileOpen

Immutably borrows from an owned value. Read more
source§

impl<'a> Borrow<FileOpen> for &'a FileWrite

source§

fn borrow(&self) -> &FileOpen

Immutably borrows from an owned value. Read more
source§

impl Borrow<FileOpen> for FileEdit

source§

fn borrow(&self) -> &FileOpen

Immutably borrows from an owned value. Read more
source§

impl Borrow<FileOpen> for FileRead

source§

fn borrow(&self) -> &FileOpen

Immutably borrows from an owned value. Read more
source§

impl Borrow<FileOpen> for FileWrite

source§

fn borrow(&self) -> &FileOpen

Immutably borrows from an owned value. Read more
source§

impl Debug for FileOpen

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<FileEdit> for FileOpen

source§

fn from(orig: FileEdit) -> FileOpen

Converts to this type from the input type.
source§

impl From<FileOpen> for File

source§

fn from(orig: FileOpen) -> File

Converts to this type from the input type.
source§

impl From<FileRead> for FileOpen

source§

fn from(orig: FileRead) -> FileOpen

Converts to this type from the input type.
source§

impl From<FileWrite> for FileOpen

source§

fn from(orig: FileWrite) -> FileOpen

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.