pub struct FileOptions { /* private fields */ }
Expand description
Metadata for a file to be written
Implementations§
Source§impl FileOptions
impl FileOptions
Sourcepub fn compression_method(self, method: CompressionMethod) -> FileOptions
pub fn compression_method(self, method: CompressionMethod) -> FileOptions
Set the compression method for the new file
The default is CompressionMethod::Deflated
. If the deflate compression feature is
disabled, CompressionMethod::Stored
becomes the default.
Sourcepub fn compression_level(self, level: Option<i32>) -> FileOptions
pub fn compression_level(self, level: Option<i32>) -> FileOptions
Set the compression level for the new file
None
value specifies default compression level.
Range of values depends on compression method:
Deflated
: 0 - 9. Default is 6Bzip2
: 0 - 9. Default is 6Zstd
: -7 - 22, with zero being mapped to default level. Default is 3- others: only
None
is allowed
Sourcepub fn last_modified_time(self, mod_time: DateTime) -> FileOptions
pub fn last_modified_time(self, mod_time: DateTime) -> FileOptions
Set the last modified time
The default is the current timestamp if the ‘time’ feature is enabled, and 1980-01-01 otherwise
Sourcepub fn unix_permissions(self, mode: u32) -> FileOptions
pub fn unix_permissions(self, mode: u32) -> FileOptions
Set the permissions for the new file.
The format is represented with unix-style permissions.
The default is 0o644
, which represents rw-r--r--
for files,
and 0o755
, which represents rwxr-xr-x
for directories.
This method only preserves the file permissions bits (via a & 0o777
) and discards
higher file mode bits. So it cannot be used to denote an entry as a directory,
symlink, or other special file type.
Sourcepub fn large_file(self, large: bool) -> FileOptions
pub fn large_file(self, large: bool) -> FileOptions
Set whether the new file’s compressed and uncompressed size is less than 4 GiB.
If set to false
and the file exceeds the limit, an I/O error is thrown. If set to true
,
readers will require ZIP64 support and if the file does not exceed the limit, 20 B are
wasted. The default is false
.
Trait Implementations§
Source§impl Clone for FileOptions
impl Clone for FileOptions
Source§fn clone(&self) -> FileOptions
fn clone(&self) -> FileOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl FileOptionsExt for FileOptions
impl FileOptionsExt for FileOptions
Source§fn with_deprecated_encryption(self, password: &[u8]) -> Self
fn with_deprecated_encryption(self, password: &[u8]) -> Self
impl Copy for FileOptions
Auto Trait Implementations§
impl Freeze for FileOptions
impl RefUnwindSafe for FileOptions
impl Send for FileOptions
impl Sync for FileOptions
impl Unpin for FileOptions
impl UnwindSafe for FileOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more