Struct misc_utils::fs::WriteOptions
[−]
[src]
pub struct WriteOptions { /* fields omitted */ }
Configure behaviour of the file_open_write
function.
Defaults
WriteOptions {
buffer_capacity: None,
compression_level: Compression::Default,
filetype: FileType::PlainText,
open_options: OpenOptions::new(),
threads: 1,
};
Methods
impl WriteOptions
[src]
fn new() -> Self
[src]
Create a new WriteOptions
with default settings.
fn set_buffer_capacity(self, capacity: usize) -> Self
[src]
Sets the capacity of the BufReader
to capacity
in Bytes.
fn set_compression_level(self, compression: Compression) -> Self
[src]
Sets the compression level for archives.
This configures the compression level used. This option has no effect if the FileType
is PlainText
. See Compression
for a description of the possible values.
fn set_filetype(self, ty: FileType) -> Self
[src]
Sets the output filetype.
This specifies if the file will be plaintext or which archive form will be used. See
FileType
for details on the possible values.
fn set_open_options<B>(self, open_options: B) -> Self where
B: Borrow<OpenOptions>,
[src]
B: Borrow<OpenOptions>,
Specify a set of OpenOptions
to use.
The option read
will always be overwritten to false
and write
will always be set to
true
.
This allows to specify flags like append
or truncate
while writing.
fn set_threads(self, threads: u32) -> Self
[src]
Specify the maximal number of threads used for compression.
This gives a hint to the encoder that threading is wanted. This feature is currently only
used with xz
. The writer will the value of threads
as a maximal number.
Setting this option to 0
has the same effect as setting it to 1
.
Trait Implementations
impl Clone for WriteOptions
[src]
fn clone(&self) -> WriteOptions
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for WriteOptions
[src]
impl Default for WriteOptions
[src]
impl PartialEq for WriteOptions
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.