pub struct ExtendedFileOptions { /* private fields */ }Expand description
The Extension for Extra Data and Central Extra Data
Implementations§
Source§impl ExtendedFileOptions
impl ExtendedFileOptions
Sourcepub fn add_extra_data<D: AsRef<[u8]>>(
&mut self,
header_id: u16,
data: D,
central_only: bool,
) -> ZipResult<()>
👎Deprecated: use add_extra_field()
pub fn add_extra_data<D: AsRef<[u8]>>( &mut self, header_id: u16, data: D, central_only: bool, ) -> ZipResult<()>
use add_extra_field()
Adds an extra data field, unless we detect that it’s invalid.
§Parameters
header_id– The 2‑byte identifier of the ZIP extra field to add. This value determines the type/format ofdataand should either be one of the standard ZIP extra field IDs defined by the ZIP specification or an application‑specific (vendor) ID.data– The raw payload for the extra field, without the leading header ID or length; those are derived fromheader_idanddata.len()and written automatically.central_only– Controls where the extra field is stored:- When
true, the field is appended only to the central directory extra data (central_extra_data), and the corresponding local file header is left unchanged. - When
false, the field is appended to the local file header extra data (extra_data) and may also be reflected in the central directory, depending on how the ZIP is written.
- When
The combined size of all extra data (local + central) must not exceed
u16::MAX. If adding this field would exceed that limit or produce an
invalid extra data structure, an error is returned and no data is
added.
Sourcepub fn add_extra_field<D: AsRef<[u8]>>(
&mut self,
header_id: u16,
data: D,
central_only: bool,
) -> ZipResult<()>
pub fn add_extra_field<D: AsRef<[u8]>>( &mut self, header_id: u16, data: D, central_only: bool, ) -> ZipResult<()>
Adds an extra field, unless we detect that it’s invalid.
§Parameters
header_id– The 2‑byte identifier of the ZIP extra field to add. This value determines the type/format ofdataand should either be one of the standard ZIP extra field IDs defined by the ZIP specification or an application‑specific (vendor) ID.data– The raw payload for the extra field, without the leading header ID or length; those are derived fromheader_idanddata.len()and written automatically.central_only– Controls where the extra field is stored:- When
true, the field is appended only to the central directory extra data (central_extra_data), and the corresponding local file header is left unchanged. - When
false, the field is appended to the local file header extra data (extra_data) and may also be reflected in the central directory, depending on how the ZIP is written.
- When
The combined size of all extra data (local + central) must not exceed
u16::MAX. If adding this field would exceed that limit or produce an
invalid extra data structure, an error is returned and no data is
added.
Trait Implementations§
Source§impl Clone for ExtendedFileOptions
impl Clone for ExtendedFileOptions
Source§fn clone(&self) -> ExtendedFileOptions
fn clone(&self) -> ExtendedFileOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExtendedFileOptions
impl Debug for ExtendedFileOptions
Source§impl Default for ExtendedFileOptions
impl Default for ExtendedFileOptions
Source§fn default() -> ExtendedFileOptions
fn default() -> ExtendedFileOptions
Returns the “default value” for a type. Read more
impl Eq for ExtendedFileOptions
Source§impl PartialEq for ExtendedFileOptions
impl PartialEq for ExtendedFileOptions
impl StructuralPartialEq for ExtendedFileOptions
Auto Trait Implementations§
impl Freeze for ExtendedFileOptions
impl RefUnwindSafe for ExtendedFileOptions
impl Send for ExtendedFileOptions
impl Sync for ExtendedFileOptions
impl Unpin for ExtendedFileOptions
impl UnsafeUnpin for ExtendedFileOptions
impl UnwindSafe for ExtendedFileOptions
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.