[][src]Struct splitfile::OpenOptions

pub struct OpenOptions { /* fields omitted */ }

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

This builder mirrors the usage and options of fs::OpenOptions, and returns a SplitFile instance.

Implementations

impl OpenOptions[src]

pub fn new() -> OpenOptions[src]

Creates a blank set of options ready for configuartion.

All options are initially set to false.

pub fn read(&mut self, read: bool) -> &mut OpenOptions[src]

Sets the option for read access.

This option, when true, will indicate that the file should be read-able if opened.

pub fn write(&mut self, write: bool) -> &mut OpenOptions[src]

Sets the option for write access.

This option, when true, will indicate that the file should be write-able if opened.

pub fn append(&mut self, append: bool) -> &mut OpenOptions[src]

Sets the option for append mode.

This option, when true, means that writes will append to a file instead of overwriting previous contents.

pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions[src]

Sets the option for trncating a previous file. This truncate the first volume, and delete all additional volume files using fs::remove_file.

pub fn create(&mut self, create: bool) -> &mut OpenOptions[src]

Sets the option for creating a new file.

This option indicates whether a new file will be created if the file does not yet already exist.

In order for the file to be created, write or append access must be used.

pub fn create_new(&mut self, create_new: bool) -> &mut OpenOptions[src]

Sets the option to always create a new file.

This option indicates whether a new file will be created. No file is allowed to exist at the target location, also no (dangling) symlink.

pub fn open<P: AsRef<Path>>(&self, path: P, volsize: u64) -> Result<SplitFile>[src]

Opens a file at path with the options specified by self. Path refers to the path of the first volume. Volsize is the maximum size of each volume.

Trait Implementations

impl Clone for OpenOptions[src]

impl Debug for OpenOptions[src]

impl Default for OpenOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.