logo
pub struct OpenOptions { /* private fields */ }
Expand description

Options and flags which can be used to configure how a file is opened.

This corresponds to std::fs::OpenOptions.

This OpenOptions has no open method. To open a file with an OptionOptions, first obtain a Dir containing the path, and then call Dir::open_with.

We need to define our own version because the libstd `OpenOptions` doesn't have public accessors that we can use.

Implementations

Creates a blank new set of options ready for configuration.

This corresponds to std::fs::OpenOptions::new.

Sets the option for read access.

This corresponds to std::fs::OpenOptions::read.

Sets the option for write access.

This corresponds to std::fs::OpenOptions::write.

Sets the option for the append mode.

This corresponds to std::fs::OpenOptions::append.

Sets the option for truncating a previous file.

This corresponds to std::fs::OpenOptions::truncate.

Sets the option to create a new file.

This corresponds to std::fs::OpenOptions::create.

Sets the option to always create a new file.

This corresponds to std::fs::OpenOptions::create_new.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Sets the mode bits that a new file will be created with. Read more
Pass custom flags to the flags argument of open. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.